GNOME Bugzilla – Bug 516509
gstid3v2mux.cc build failure on Solaris, CFLAGS not valid for CXX
Last modified: 2008-07-08 13:59:37 UTC
I'm building gst-plugins-good on x86_64-sun-solaris2.10 with the Sun Workshop 12 compilers (C and C++), OS and compilers are completely up to date with patches. I get a compile failure for gstid3v2mux.cc: /bin/bash ../../libtool --tag=CXX --mode=compile CC -DHAVE_CONFIG_H -I. -I../.. -I/local/include/X11 -I/local/include -I/local/gnu/include/X11 -I/local/gnu/include -D_REENTRANT -D_PTHREADS -I/local/gnu/include/gstreamer-0.10 -I/local/gnu/include/glib-2.0 -I/local/gnu/lib/64/glib-2.0/include -I/local/gnu/include/libxml2 -I../../gst-libs -I../../gst-libs -D_REENTRANT -D_PTHREADS -I/local/gnu/include/gstreamer-0.10 -I/local/gnu/include/glib-2.0 -I/local/gnu/lib/64/glib-2.0/include -I/local/gnu/include/libxml2 -errwarn=%all,no%E_EMPTY_DECLARATION,no%E_STATEMENT_NOT_REACHED,no%E_ARGUEMENT_MISMATCH,no%E_MACRO_REDEFINED -g -I/local/include/taglib -xO2 -library=stlport4 -library=Crun -D__func__=\"unknown\" -KPIC -m64 -xtarget=native -xarch=native -c -o libgsttaglib_la-gstid3v2mux.lo `test -f 'gstid3v2mux.cc' || echo './'`gstid3v2mux.cc CC -DHAVE_CONFIG_H -I. -I../.. -I/local/include/X11 -I/local/include -I/local/gnu/include/X11 -I/local/gnu/include -D_REENTRANT -D_PTHREADS -I/local/gnu/include/gstreamer-0.10 -I/local/gnu/include/glib-2.0 -I/local/gnu/lib/64/glib-2.0/include -I/local/gnu/include/libxml2 -I../../gst-libs -I../../gst-libs -D_REENTRANT -D_PTHREADS -I/local/gnu/include/gstreamer-0.10 -I/local/gnu/include/glib-2.0 -I/local/gnu/lib/64/glib-2.0/include -I/local/gnu/include/libxml2 -errwarn=%all,no%E_EMPTY_DECLARATION,no%E_STATEMENT_NOT_REACHED,no%E_ARGUEMENT_MISMATCH,no%E_MACRO_REDEFINED -g -I/local/include/taglib -xO2 -library=stlport4 -library=Crun -D__func__=\"unknown\" -KPIC -m64 -xtarget=native -xarch=native -c gstid3v2mux.cc -DPIC Bad value 'E_EMPTY_DECLARATION' for flag '-errwarn' for '/opt/SUNWspro/prod/bin/ccfe'. Bad value 'E_STATEMENT_NOT_REACHED' for flag '-errwarn' for '/opt/SUNWspro/prod/bin/ccfe'. Bad value 'E_ARGUEMENT_MISMATCH' for flag '-errwarn' for '/opt/SUNWspro/prod/bin/ccfe'. Bad value 'E_MACRO_REDEFINED' for flag '-errwarn' for '/opt/SUNWspro/prod/bin/ccfe'. 4 Error(s) detected. This happens because (unlike gcc/g++), flags that are valid for the C compiler (e.g. -errwarn =%all,no%E_EMPTY_DECLARATION,etc.... ) are not necessarily valid for the C++ compiler. gstid3v2mux.cc is being compiled by the C++ compiler, but it's being passed GST_CFLAGS, which includes ERROR_CFLAGS, which is where the offending command line argument is coming from. It's easy to imagine that some of the other *_CFLAGS that go into GST_CFLAGS might also be valid for a particular C compiler but not its C++ counterpart. The best fix would be to have *_CXXFLAGS variants of all ERROR_CFLAGS, DEBUG_CFLAGS, PROFILE_CFLAGS, DEPRECATED_CFLAGS, etc, and then use those when building any C++ source files. This will require more tests at configure time, though. One workaround is to use "make ERROR_CFLAGS=" in ext/taglib. That gets me by this problem.
> The best fix would be to have *_CXXFLAGS variants of all ERROR_CFLAGS, > DEBUG_CFLAGS, PROFILE_CFLAGS, DEPRECATED_CFLAGS, etc, and then use those when > building any C++ source files. This will require more tests at configure time, > though Not sure about the others, but ERROR_CXXFLAGS would be good.
Should be fixed in CVS: 2008-02-23 Tim-Philipp Müller <tim at centricular dot net> * configure.ac: * ext/taglib/Makefile.am: Check for and define ERROR_CXXFLAGS and use them when building C++ code (#516509). (plus a bunch of additions in the common module). Haven't checked the Forte bits though. Please check out CVS and re-open if there are still problems. Thanks!
I just checked against CVS from 2008-02-27. The original problem is unfortunately still present, and the new configure check for ERROR_CXXFLAGS isn't working correctly on Solaris. It's not your fault, though -- it's either AS_COMPILER_FLAGS or Solaris' C++ compiler that's really to blame. Here's what configure outputs: checking to see if compiler understands -Wall... no checking to see if compiler understands -Werror... no checking to see if compiler understands -errwarn=%all... checking to see if comp iler understands -errwarn=%all,no%E_EMPTY_DECLARATION... yes checking to see if compiler understands -errwarn=%all,no%E_STATEMENT_NOT_REACHED ... yes checking to see if compiler understands -errwarn=%all,no%E_ARGUEMENT_MISMATCH... yes checking to see if compiler understands -errwarn=%all,no%E_MACRO_REDEFINED... ye s yes configure: set ERROR_CFLAGS to -errwarn=%all,no%E_EMPTY_DECLARATION,no%E_STATEME NT_NOT_REACHED,no%E_ARGUEMENT_MISMATCH,no%E_MACRO_REDEFINED checking to see if c++ compiler understands ... yes checking to see if c++ compiler understands -Wall... yes checking to see if c++ compiler understands -Werror... yes checking to see if c++ compiler understands -Wno-non-virtual-dtor... yes configure: set ERROR_CXXFLAGS to -Wall -Werror -Wno-non-virtual-dtor The problem is that C++ does this when you pass it a "-Wfoo" option: configure:32049: checking to see if c++ compiler understands -Wall configure:32083: CC -c -xO2 -library=stlport4 -library=Crun -KPIC -m64 -xtarget= native -xarch=native -I/local/gnu/include -I/local/gnu/include -I/usr/local/incl ude -I/local/gnu/include -I/local/gnu/include -I/usr/local/include -Wall confte st.cpp >&5 CC: Warning: Option -Wall passed to ld, if ld is invoked, ignored otherwise configure:32089: $? = 0 configure:32124: result: yes Arguably Solaris' C++ compiler shouldn't just be complaining any time it's passed a -Wfoo argument and passing it off to ld, but AS_COMPILER_FLAG could be smarter too. Either way, the check isn't working, but it's not your fault. The main problem is still there, though. Even though we now have an ERROR_CXXFLAGS, ERROR_CFLAGS is still getting passed to the C++ compiler: source='gstid3v2mux.cc' object='libgsttaglib_la-gstid3v2mux.lo' libtool=yes \ DEPDIR=.deps depmode=none /bin/bash ../../depcomp \ /bin/bash ../../libtool --tag=CXX --mode=compile CC -DHAVE_CONFIG_H -I. -I../.. -I/local/gnu/include -I/local/gnu/include -I/usr/local/include -D_REENTRANT -D_PTHREADS -I/local/gnu/include/gstreamer-0.10 -I/local/gnu/include/glib-2.0 -I/local/gnu/lib/64/glib-2.0/include -I/local/gnu/include/libxml2 -I../../gst-libs -I../../gst-libs -I../../gst-libs -I../../gst-libs -D_REENTRANT -D_PTHREADS -I/local/gnu/include/gstreamer-0.10 -I/local/gnu/include/glib-2.0 -I/local/gnu/lib/64/glib-2.0/include -I/local/gnu/include/libxml2 -errwarn=%all,no%E_EMPTY_DECLARATION,no%E_STATEMENT_NOT_REACHED,no%E_ARGUEMENT_MISMATCH,no%E_MACRO_REDEFINED -g -DGST_DISABLE_DEPRECATED -Wall -Werror -Wno-non-virtual-dtor -g -DGST_DISABLE_DEPRECATED -I/local/include/taglib -xO2 -library=stlport4 -library=Crun -KPIC -m64 -xtarget=native -xarch=native -I/local/gnu/include -I/local/gnu/include -I/usr/local/include -c -o libgsttaglib_la-gstid3v2mux.lo `test -f 'gstid3v2mux.cc' || echo './'`gstid3v2mux.cc CC -DHAVE_CONFIG_H -I. -I../.. -I/local/gnu/include -I/local/gnu/include -I/usr/local/include -D_REENTRANT -D_PTHREADS -I/local/gnu/include/gstreamer-0.10 -I/local/gnu/include/glib-2.0 -I/local/gnu/lib/64/glib-2.0/include -I/local/gnu/include/libxml2 -I../../gst-libs -I../../gst-libs -I../../gst-libs -I../../gst-libs -D_REENTRANT -D_PTHREADS -I/local/gnu/include/gstreamer-0.10 -I/local/gnu/include/glib-2.0 -I/local/gnu/lib/64/glib-2.0/include -I/local/gnu/include/libxml2 -errwarn=%all,no%E_EMPTY_DECLARATION,no%E_STATEMENT_NOT_REACHED,no%E_ARGUEMENT_MISMATCH,no%E_MACRO_REDEFINED -g -DGST_DISABLE_DEPRECATED -Wall -Werror -Wno-non-virtual-dtor -g -DGST_DISABLE_DEPRECATED -I/local/include/taglib -xO2 -library=stlport4 -library=Crun -KPIC -m64 -xtarget=native -xarch=native -I/local/gnu/include -I/local/gnu/include -I/usr/local/include -c gstid3v2mux.cc -KPIC -DPIC -o .libs/libgsttaglib_la-gstid3v2mux.o CC: Warning: Option -Wall passed to ld, if ld is invoked, ignored otherwise CC: Warning: Option -Werror passed to ld, if ld is invoked, ignored otherwise CC: Warning: Option -Wno-non-virtual-dtor passed to ld, if ld is invoked, ignored otherwise Bad value 'E_EMPTY_DECLARATION' for flag '-errwarn' for '/opt/SUNWspro/prod/bin/ccfe'. Bad value 'E_STATEMENT_NOT_REACHED' for flag '-errwarn' for '/opt/SUNWspro/prod/bin/ccfe'. Bad value 'E_ARGUEMENT_MISMATCH' for flag '-errwarn' for '/opt/SUNWspro/prod/bin/ccfe'. Bad value 'E_MACRO_REDEFINED' for flag '-errwarn' for '/opt/SUNWspro/prod/bin/ccfe'. 4 Error(s) detected. gmake: *** [libgsttaglib_la-gstid3v2mux.lo] Error 1 As you can see, both ERROR_CFLAGS and ERROR_CXXFLAGS are ending up in there.
2008-07-08 Sebastian Dröge <sebastian.droege@collabora.co.uk> * configure.ac: Don't include ERROR_CFLAGS in GST_CXXFLAGS as it might include flags that are invalid for C++. Fixes bug #516509.