On 24 February 2014 19:08, Peter Maydell <peter.mayd...@linaro.org> wrote: > gcc's C++ compiler complains about being passed some -W options > which make sense for C but not for C++. This means we mustn't try > a C++ compile with QEMU_CFLAGS, but only with a filtered version > that removes the offending options. This filtering was already being > done for uses of C++ in the build itself, but was omitted for the > "does C++ work?" configure test. This only showed up when doing > builds which explicitly enabled -Werror with --enable-werror, > because the "do the compilers work" tests were mistakenly placed > above the "default werror based on whether compiling from git" code. > Further, when the test did fail configure would plunge on regardless > of the error since we were running do_cc in a subshell. Fix this > complex of errors: > > 1. Move the default-werror code up so that there are no invocations > of compile_object and friends between it and the point where we > set $werror explicitly based on the --enable-werror command line > option. > > 2. Provide a mechanism for filtering QEMU_CFLAGS to create > QEMU_CXXFLAGS, and use it for the test we run here. > > 3. Provide a do_cxx function to run a test with the C++ compiler > rather than doing cute tricks with subshells and do_cc. > > Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> > --- > This was pretty confusing to debug (mostly because I got tripped > up by the issue fixed by 1. above)... > > We could probably roll do_libtool into do_compiler, but I'd rather > not mix that cleanup up with this build-breakage fix.
Alas, this won't work for clang builds, because clang does not like us building a .c file with the C++ compiler, which the test does. thanks -- PMM