On 05/25/2016 02:05 AM, Chris Packham wrote: > Hi, > > We've run into a problem trying to compile openvswitch with CFLAGS=-Werror.
That's never a good thing to do. We explicitly recommend that you avoid CFLAGS=-Werror during configure tests, and that configure files that WANT to (possibly conditionally) enable error flags during the main compile should probe that setting independently during configure.ac. GNU Coreutils is a good example for how to do this, using gnulib's gl_WARN_ADD macro http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=blob;f=configure.ac;h=a4846011#l108 http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob;f=src/local.mk;h=12a0d55d#l20 > > I don't think it's an openvswitch problem. It appears to be a > autoconf/gcc issue. On the contrary, it IS an openvswitch problem, as you should never run configure with -Werror set for the majority of the probes. > > Any thoughts on how we can get -latomic detected and -Werror passed > through to the build? As suggested above, make the probing of whether -Werror works independent from the rest of configure, and set it in a separate variable (not CFLAGS), then use that separate variable in your Makefiles but not the rest of configure. That said, there is an open patch to autoconf to promote gnulib's gl_WARN_ADD logic into a formal autoconf macro, and that's one of the remaining things that needs to be merged in before I can release autoconf 2.70. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature