qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 9c83ff: configure: Make C++ test work with --


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 9c83ff: configure: Make C++ test work with --enable-werror
Date: Thu, 06 Mar 2014 13:30:03 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 9c83ffd859a13d840aa3f983833b6ea1e34de483
      
https://github.com/qemu/qemu/commit/9c83ffd859a13d840aa3f983833b6ea1e34de483
  Author: Peter Maydell <address@hidden>
  Date:   2014-03-06 (Thu, 06 Mar 2014)

  Changed paths:
    M configure

  Log Message:
  -----------
  configure: Make C++ test work with --enable-werror

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.
Another error in this category is that clang warns if you ask it to
compile C++ code from a file named "foo.c". Further, because we
were running do_cc in a subshell in the condition part of an "if",
the error_exit inside do_compiler wouldn't terminate configure and
we would plunge on regardless. 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.

4. Use a new temporary file TMPCXX for the C++ program fragment.

Signed-off-by: Peter Maydell <address@hidden>
Message-id: address@hidden
Tested-by: Andreas Färber <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]