On 29/07/19 14:41, Alex Bennée wrote: >> I'd suggest we don't actually /need/ per-file compiler flags in most >> cases. eg when we add $foo.o-libs += $(FOO_LIBS) that's not really >> a per-file setting when it gets expanded onto the final linker line. >> Its just a "-lfoo" that gets used for the library as a while. > We do for tests, often to select a specific processor type or feature we > need to build that particular instance of the test.
Tests are also adding cflags per-executable, not per-.o file: tests/tcg/aarch64/Makefile.softmmu-target:memory: CFLAGS+=-DCHECK_UNALIGNED=1 tests/tcg/alpha/Makefile.softmmu-target:memory: CFLAGS+=-DCHECK_UNALIGNED=0 tests/tcg/alpha/Makefile.target:test-cmov: EXTRA_CFLAGS=-DTEST_CMOV tests/tcg/arm/Makefile.softmmu-target:test-armv6m-undef: EXTRA_CFLAGS+=-mcpu=cortex-m0 tests/tcg/arm/Makefile.target:hello-arm: CFLAGS+=-marm -ffreestanding tests/tcg/arm/Makefile.target:test-arm-iwmmxt: CFLAGS+=-marm -march=iwmmxt -mabi=aapcs -mfpu=fpv4-sp-d16 tests/tcg/arm/Makefile.target:# fcvt: CFLAGS+=-march=armv8.2-a+fp16 -mfpu=neon-fp-armv8 tests/tcg/i386/Makefile.softmmu-target:memory: CFLAGS+=-DCHECK_UNALIGNED=1 tests/tcg/i386/Makefile.target:hello-i386: CFLAGS+=-ffreestanding tests/tcg/mips/Makefile.target:hello-mips: CFLAGS+=-mno-abicalls -fno-PIC -mabi=32 (They also do not use unnesting). Paolo