On 07/08/19 14:51, Alex Bennée wrote: >> For i386 specifically, this allows using the host GCC >> to compile the i386 tests. But, it should really be >> done for all targets, unless we want to pass $(EXTRA_CFLAGS) >> directly as part of $(CC). > Hmm well for softmmu the tests take the decision: > > # For softmmu targets we include a different Makefile fragement as the > # build options for bare programs are usually pretty different. They > # are expected to provide their own build recipes. > > So we are not expecting to handle multi-classing the system compiler to > generate different binaries with a common build string.
We almost do, since we have case "$cpu" in i386) CPU_CFLAGS="-m32" LDFLAGS="-m32 $LDFLAGS" cross_cc_i386=$cc cross_cc_cflags_i386="$CPU_CFLAGS" So you can compile with "./configure --cpu=i386" and have it use "gcc -m32" as a cross compiler on x86_64, also for TCG tests. So it seemed half-baked to me. > To be honest I > wonder if we should just drop the EXTRA_CFLAGS shenanigans in favour of > an explicit compiler per target? I don't know. I think supporting "gcc -m32" on x86_64 is a good idea though. Yet another possibility is to use "--cross-cc-i386='gcc -m32'" directly, but that would be a separate patch. For these I really wanted to have no semantic change. Paolo