GNOME Bugzilla – Bug 575695
build fails on OpenSolaris due to incorrect header file inclusion order
Last modified: 2009-03-18 07:33:34 UTC
Please describe the problem: While building gstreamer HEAD on OpenSolaris Nevada build 101, the following build error occurs: Steps to reproduce: Actual results: Making all in parse CC gst.o In file included from gst_private.h:28, from gst.c:108: ../config.h:306:1: "_FILE_OFFSET_BITS" redefined In file included from /usr/include/stdio.h:40, from /space/buildbot/prefix/include/libxml2/libxml/tree.h:15, from /space/buildbot/prefix/include/libxml2/libxml/parser.h:16, from gstconfig.h:171, from gst.c:106: /usr/include/sys/feature_tests.h:209:1: this is the location of the previous definition (build stops here) Expected results: Does this happen every time? Other information: This is because config.h defines _FILE_OFFSET_BITS, which the Solaris headers also define. This can be fixed by reordering the includes - see bug 71704 for an example. See also: http://www.redhat.com/archives/libvir-list/2008-December/msg00454.html Full uname: SunOS manduba 5.11 snv_101 sun4u sparc SUNW,Ultra-Enterprise GCC version: Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.11/3.4.3/specs Configured with: /gates/sfwnv/builds/sfwnv-gate/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/ccs/bin/as --without-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++,f77,objc --enable-shared Thread model: posix gcc version 3.4.3 (csl-sol210-3_4-20050802)
Created attachment 130828 [details] [review] patch to fix include order in gst.c This patch allows the build to complete successfully. An alternative solution might be including config.h as the first include.
Committed, thanks for the patch: commit 7d7fceced5c40fbfafd1a2c32c95f82d86d84bbd Author: David Adam <zanchey@ucc.gu.uwa.edu.au> Date: Tue Mar 17 20:41:44 2009 +0000 config.h needs to be included first, either directly or via gst_private.h Fixes build with -Werror caused by '_FILE_OFFSET_BITS redefined' warning on OpenSolaris where _FILE_OFFSET_BITS may be defined both in our config.h and via stdio.h (#575695).
Confirming fixed with 7d7fceced5c40fbfafd1a2c32c95f82d86d84bbd