From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WILOO-0003ht-Cf for qemu-devel@nongnu.org; Tue, 25 Feb 2014 12:02:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WILOJ-00058b-L1 for qemu-devel@nongnu.org; Tue, 25 Feb 2014 12:02:04 -0500 Received: from mail-la0-f46.google.com ([209.85.215.46]:47900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WILOJ-00056k-63 for qemu-devel@nongnu.org; Tue, 25 Feb 2014 12:01:59 -0500 Received: by mail-la0-f46.google.com with SMTP id hr17so1471256lab.33 for ; Tue, 25 Feb 2014 09:01:58 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1393268898-20599-1-git-send-email-peter.maydell@linaro.org> References: <1393268898-20599-1-git-send-email-peter.maydell@linaro.org> From: Peter Maydell Date: Tue, 25 Feb 2014 17:01:37 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] configure: Make C++ test work with --enable-werror List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Cc: Alexey Kardashevskiy , Patch Tracking , Thomas Huth , =?UTF-8?Q?Andreas_F=C3=A4rber?= On 24 February 2014 19:08, Peter Maydell 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 > --- > 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