Results of gcc 4.7 and mingw-w64 trunk mass rebuild on Fedora

Erik van Pienbroek erik at vanpienbroek.nl
Wed Jan 18 23:24:27 UTC 2012


Hi,

As the Fedora project recently decided to introduce a recent gcc 4.7
snapshot and perform a mass rebuild of all packages using it I decided
to perform a mass rebuild as well for all cross compiled packages which
are currently in the Fedora mingw-w64 testing repository
(https://fedoraproject.org/wiki/MinGW/CrossCompilerFramework)

For this mass rebuild I've used the following toolchain releases:
binutils: 2.22.51 (20120112 snapshot)
gcc: 4.7 (20120106 snapshot)
mingw-w64: trunk (20120112 snapshot with r4737 and r4738 to fix wcslen)

Support for the experimental winpthreads wasn't included in this mass
rebuild. A patched copy of pthreads was used to enable libgomp support
in GCC.

The complete list of packages which were rebuild can be found at
http://svn.openftd.org/viewvc/Fedora%20Cross%20Compiler%20Framework/

Here are the statistics of this mass rebuild:
Total number of packages: 142
Successful builds: 131
Failed builds: 11

The following packages failed to build:
boost-1.47.0
dbus-1.4.8
gettext-0.18.1.1
glib2-2.31.8
kdelibs-4.7.97
libgpg-error-1.10
libvirt-0.9.8
OpenSceneGraph-2.8.3
qpid-cpp-0.12
qt-4.8.0
webkitgtk-1.6.1

Here are the details of the individual failures

-----

boost-1.47.0:

In file included
from /builddir/build/BUILD/boost_1_47_0/boost/thread/detail/platform.hpp:17:0,

from /builddir/build/BUILD/boost_1_47_0/boost/thread/thread.hpp:12,

from /builddir/build/BUILD/boost_1_47_0/libs/thread/src/win32/thread.cpp:10:
/builddir/build/BUILD/boost_1_47_0/boost/config/requires_threads.hpp:29:4: error: #error "Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS"

This seems to be caused by a change in behavior in gcc 4.7 wrt thread
support. See https://svn.boost.org/trac/boost/ticket/6165 for more
details. A workaround is available in that ticket to fix the failure.

Thomas Sailer (the Fedora package maintainer of the mingw32-boost
package) already applied some changes which are required to build
boost using gcc 4.7 and he updated to boost-1.48.0 at the same time.
I already forward-ported these changes to the boost package in
the mingw-w64 testing repository so the package builds fine now.

-----

dbus-1.4.8:

../../dbus/dbus-sysdeps.c: In function '_dbus_error_from_errno':
../../dbus/dbus-sysdeps.c:916:5: error: duplicate case value
../../dbus/dbus-sysdeps.c:912:5: error: previously used here
../../dbus/dbus-sysdeps.c:924:5: error: duplicate case value
../../dbus/dbus-sysdeps.c:920:5: error: previously used here
../../dbus/dbus-sysdeps.c:956:5: error: duplicate case value
../../dbus/dbus-sysdeps.c:952:5: error: previously used here
../../dbus/dbus-sysdeps.c:964:5: error: duplicate case value
../../dbus/dbus-sysdeps.c:960:5: error: previously used here
../../dbus/dbus-sysdeps.c:972:5: error: duplicate case value
../../dbus/dbus-sysdeps.c:968:5: error: previously used here
../../dbus/dbus-sysdeps.c:980:5: error: duplicate case value
../../dbus/dbus-sysdeps.c:976:5: error: previously used here

The lines mentioned contain the contents:
dbus-sysdeps.c:912 - case EPROTONOSUPPORT:
dbus-sysdeps.c:916 - case WSAEPROTONOSUPPORT:

dbus-sysdeps.c:920 - case EAFNOSUPPORT:
dbus-sysdeps.c:924 - case WSAEAFNOSUPPORT:

dbus-sysdeps.c:952 - case ECONNREFUSED:
dbus-sysdeps.c:956 - case WSAECONNREFUSED:

dbus-sysdeps.c:960 - case ETIMEDOUT:
dbus-sysdeps.c:964 - case WSAETIMEDOUT:

dbus-sysdeps.c:968 - case ENETUNREACH:
dbus-sysdeps.c:972 - case WSAENETUNREACH:

dbus-sysdeps.c:976 - case EADDRINUSE:
dbus-sysdeps.c:980 - case WSAEADDRINUSE:

It looks like a change was done in the mingw-w64 headers recently which
makes various WSA error code defines contain exactly the same value as
their errno counterparts. I don't know if this is the correct change or
not, but it does break compilation of packages.

-----

gettext-0.18.1.1:

../../../gettext-tools/gnulib-lib/vsnprintf.c:40:1: error: redefinition
of 'vsnprintf'
In file included from ./stdio.h:35:0,
                 from ../../../gettext-tools/gnulib-lib/vsnprintf.c:24:
/usr/i686-w64-mingw32/sys-root/mingw/include/stdio.h:545:7: note:
previous definition of 'vsnprintf' was here
make[3]: *** [vsnprintf.lo] Error 1

Apparently the gettext build scripts think that there's no vsnprintf on
win32/win64 and therefore tries to build its own implementation.

Upon further investigation I think I've found the cause for this false
assumption. Here's a snippet from the configure script config.log:

configure:43169: checking for vsnprintf
configure:43169: i686-w64-mingw32-gcc -std=gnu99 -o conftest.exe  -O2 -g
-pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
--param=ssp-buffer-size=4 -mms-bitfields
-I/usr/i686-w64-mingw32/sys-root/mingw/include
-Wl,--disable-auto-import conftest.c  >&5
conftest.c:336:6: warning: conflicting types for built-in function
'vsnprintf' [enabled by default]
/tmp/ccvXYksQ.o: In function `main':
/home/erik/fedora_cross/mingw-gettext/gettext-0.18.1.1/build_win32/gettext-tools/conftest.c:347: undefined reference to `vsnprintf'
collect2: error: ld returned 1 exit status
configure:43169: $? = 1
configure: failed program was:
| /* confdefs.h */
<<<trimmed some irrelevant #define's>>>
| /* end confdefs.h.  */
| /* Define vsnprintf to an innocuous variant, in case <limits.h>
declares vsnprintf.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define vsnprintf innocuous_vsnprintf
| 
| /* System header to define __stub macros and hopefully few prototypes,
|     which can conflict with char vsnprintf (); below.
|     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|     <limits.h> exists even on freestanding compilers.  */
| 
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| 
| #undef vsnprintf
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char vsnprintf ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_vsnprintf || defined __stub___vsnprintf
| choke me
| #endif
| 
| int
| main ()
| {
| return vsnprintf ();
|   ;
|   return 0;
| }
configure:43169: result: no

I haven't really further investigated this issue yet

-----

glib-2.31.8:

../../gio/gsocket.c:335:3: error: duplicate case value
../../gio/gsocket.c:332:3: error: previously used here

The mentioned lines have these contents:
gsocket.c:332 - case ENOTSOCK:
gsocket.c:335 - case WSAENOTSOCK:

This looks like the same cause as the dbus failure

-----

kdelibs-4.7.97:

Failed to build because I didn't manage to get qt-4.8.0 compiled
using gcc 4.7. See below for details about the qt failure

----

libgpg-error-1.10:

In file included from ../../src/code-from-errno.c:29:0:
./code-from-errno.h:22:1: error: expected identifier or '(' before '-'
token
../../src/code-from-errno.c: In function 'gpg_err_code_from_errno':
../../src/code-from-errno.c:47:33: error: 'err_code_from_index'
undeclared (first use in this function)
../../src/code-from-errno.c:47:33: note: each undeclared identifier is
reported only once for each function it appears in
../../src/code-from-errno.c: In function 'gpg_err_code_from_syserror':
../../src/code-from-errno.c:68:33: error: 'err_code_from_index'
undeclared (first use in this function)
../../src/code-from-errno.c:69:1: warning: control reaches end of
non-void function [-Wreturn-type]
../../src/code-from-errno.c: In function 'gpg_err_code_from_errno':
../../src/code-from-errno.c:48:1: warning: control reaches end of
non-void function [-Wreturn-type]
make[3]: *** [libgpg_error_la-code-from-errno.lo] Error 1

The file code-from-errno.h is an auto-generated file. The mentioned line
contains '-2147168224     GPG_ERR_EPROTO'.

The undeclared messages are a side-effect of the first error.

The value for GPG_ERR_EPROTO seems to come from mingw-w64 headers' errno.h :
#define EPROTO 0x8004D020
The helper tool which generates the code-from-errno.h tries to map
all possible error codes in an array. As arrays apparently can only
contain 2^31-1 elements a wrap-around errors (the result of the call
printf("%i", EPROTO) is -2147168224) which confuses the helper tool.

This looks much related to the dbus and glib2 failures.
Are the error code defines really correct in mingw-w64 trunk?

-----

libvirt-0.9.8:

stdio-read.c:104:1: error: redefinition of 'vscanf'
In file included from ./stdio.h:46:0,
                 from stdio-read.c:23:
/usr/i686-w64-mingw32/sys-root/mingw/include/stdio.h:397:7: note:
previous definition of 'vscanf' was here
stdio-read.c:110:1: error: redefinition of 'vfscanf'
In file included from ./stdio.h:46:0,
                 from stdio-read.c:23:
/usr/i686-w64-mingw32/sys-root/mingw/include/stdio.h:384:7: note:
previous definition of 'vfscanf' was here
make[4]: *** [stdio-read.lo] Error 1

This one looks very similar to the gettext failure. The file in question
is part of gnulib which is bundled with both gettext and libvirt.

-----

OpenSceneGraph-2.8.3:

/usr/bin/i686-w64-mingw32-g++   -Dosg_EXPORTS -DOSG_DEBUG_POSTFIX=d
-DOSG_LIBRARY -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
--param=ssp-buffer-size=4 -mms-bitfields  -Wparentheses -Wno-long-long
-Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas
-Wunused -fpermissive @CMakeFiles/osg.dir/includes_CXX.rsp   -o
CMakeFiles/osg.dir/ShapeDrawable.obj
-c /home/erik/fedora_cross/mingw32-OpenSceneGraph/mingw32-OpenSceneGraph-2.8.3/OpenSceneGraph-2.8.3/src/osg/ShapeDrawable.cpp
/home/erik/fedora_cross/mingw32-OpenSceneGraph/mingw32-OpenSceneGraph-2.8.3/OpenSceneGraph-2.8.3/src/osg/ShapeDrawable.cpp: In member function 'void PrimitiveShapeVisitor::createHalfSphere(unsigned int, unsigned int, float, int, float, const Matrix&)':
/home/erik/fedora_cross/mingw32-OpenSceneGraph/mingw32-OpenSceneGraph-2.8.3/OpenSceneGraph-2.8.3/src/osg/ShapeDrawable.cpp:1390:11: warning: variable 'nzBase' set but not used [-Wunused-but-set-variable]
/home/erik/fedora_cross/mingw32-OpenSceneGraph/mingw32-OpenSceneGraph-2.8.3/OpenSceneGraph-2.8.3/src/osg/ShapeDrawable.cpp:1391:11: warning: variable 'nRatioBase' set but not used [-Wunused-but-set-variable]
/home/erik/fedora_cross/mingw32-OpenSceneGraph/mingw32-OpenSceneGraph-2.8.3/OpenSceneGraph-2.8.3/src/osg/ShapeDrawable.cpp: In member function 'virtual void PrimitiveShapeVisitor::apply(const osg::Cone&)':
/home/erik/fedora_cross/mingw32-OpenSceneGraph/mingw32-OpenSceneGraph-2.8.3/OpenSceneGraph-2.8.3/src/osg/ShapeDrawable.cpp:1682:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccf9y0jy.out file, please attach
this to your bugreport.
make[2]: *** [src/osg/CMakeFiles/osg.dir/ShapeDrawable.obj] Fout 1

This internal compiler error is reproducible.
If you anybody is interested in the .out file just let me know and I'll
send it in private mail (it's 1,3MB uncompressed).

-----

qpid-cpp-0.12:

When trying to build this package against the latest boost-1.48.0
the build will initially fail because of CMake fails to detect boost.
See http://koji.fedoraproject.org/koji/getfile?taskID=3709765&name=build.log
for the build logs of the Fedora package (build against the mingw.org toolchain).

To work around it in the Fedora mingw-w64 testing repo I commented
out the include(...) line (line 15) in the file
/usr/i686-w64-mingw32/sys-root/mingw/share/cmake/boost/BoostConfig.cmake
which makes the boost detection succeed.

Unfortunately the build fails later on:

/home/erik/fedora_cross/mingw32-qpid-cpp/qpid-0.12/cpp/src/qpid/sys/windows/uuid.cpp: In function 'int uuid_is_null(const uint8_t*)':
/home/erik/fedora_cross/mingw32-qpid-cpp/qpid-0.12/cpp/src/qpid/sys/windows/uuid.cpp:45:30: error: cast from type 'const uint8_t* {aka const unsigned char*}' to type 'UUID* {aka _GUID*}' casts away qualifiers [-Werror=cast-qual]
/home/erik/fedora_cross/mingw32-qpid-cpp/qpid-0.12/cpp/src/qpid/sys/windows/uuid.cpp: In function 'int uuid_parse(const char*, uint8_t*)':
/home/erik/fedora_cross/mingw32-qpid-cpp/qpid-0.12/cpp/src/qpid/sys/windows/uuid.cpp:49:44: error: cast from type 'const char*' to type 'unsigned char*' casts away qualifiers [-Werror=cast-qual]
/home/erik/fedora_cross/mingw32-qpid-cpp/qpid-0.12/cpp/src/qpid/sys/windows/uuid.cpp: In function 'void uuid_unparse(const uint8_t*, char*)':
/home/erik/fedora_cross/mingw32-qpid-cpp/qpid-0.12/cpp/src/qpid/sys/windows/uuid.cpp:54:29: error: cast from type 'const uint8_t* {aka const unsigned char*}' to type 'UUID* {aka _GUID*}' casts away qualifiers [-Werror=cast-qual]
/home/erik/fedora_cross/mingw32-qpid-cpp/qpid-0.12/cpp/src/qpid/sys/windows/uuid.cpp: In function 'int uuid_compare(const uint8_t*, const uint8_t*)':
/home/erik/fedora_cross/mingw32-qpid-cpp/qpid-0.12/cpp/src/qpid/sys/windows/uuid.cpp:66:30: error: cast from type 'const uint8_t* {aka const unsigned char*}' to type 'UUID* {aka _GUID*}' casts away qualifiers [-Werror=cast-qual]
/home/erik/fedora_cross/mingw32-qpid-cpp/qpid-0.12/cpp/src/qpid/sys/windows/uuid.cpp:66:40: error: cast from type 'const uint8_t* {aka const unsigned char*}' to type 'UUID* {aka _GUID*}' casts away qualifiers [-Werror=cast-qual]
cc1plus: all warnings being treated as errors

I didn't really bother to investigate these warnings so I
decided to temporary strip the -Werror from the compiler flags.
However, that turned out not to be  enough as another compile
failure also occurs:

/home/erik/fedora_cross/mingw32-qpid-cpp/qpid-0.12/cpp/src/qpid/log/Logger.cpp:26:43: fatal error: boost/pool/detail/singleton.hpp: No such file or directory
compilation terminated.

This looks to be caused by the introduction of boost 1.48.0.
I guess that qpid-cpp 0.12 doesn't support boost 1.48 yet and
that the CMake boost detection issue is a packaging issue

-----

qt-4.8.0:

In file included
from /builddir/build/BUILD/qt-everywhere-opensource-src-4.8.0/src/xmlpatterns/type/qbuiltinatomictypes_p.h:55:0, 
from /builddir/build/BUILD/qt-everywhere-opensource-src-4.8.0/src/xmlpatterns/type/qbuiltinatomictypes.cpp:45:
/builddir/build/BUILD/qt-everywhere-opensource-src-4.8.0/src/xmlpatterns/type/qatomiccasterlocators_p.h:570:46: error: 'virtual QPatternist::AtomicTypeVisitorResult::Ptr QPatternist::ToDerivedIntegerCasterLocator<type>::visit(const QPatternist::BooleanType*, const QPatternist::SourceLocationReflection*) const' cannot be overloaded
/builddir/build/BUILD/qt-everywhere-opensource-src-4.8.0/src/xmlpatterns/type/qatomiccasterlocators_p.h:295:46: error: with 'virtual QPatternist::AtomicTypeVisitorResult::Ptr QPatternist::ToIntegerCasterLocator::visit(const QPatternist::BooleanType*, const QPatternist::SourceLocationReflection*) const'
/builddir/build/BUILD/qt-everywhere-opensource-src-4.8.0/src/xmlpatterns/type/qatomiccasterlocators_p.h:577:46: error: 'virtual QPatternist::AtomicTypeVisitorResult::Ptr QPatternist::ToDerivedIntegerCasterLocator<type>::visit(const QPatternist::StringType*, const QPatternist::SourceLocationReflection*) const' cannot be overloaded
<more errors stripped>

This seems to be caused a change in behavior in gcc 4.7. Somebody else
also experienced this compiler error while building a native qt using
gcc 4.7: http://developer.qt.nokia.com/forums/viewthread/12606
The native qt package in Fedora also currently fails to build due to
this issue (http://koji.fedoraproject.org/koji/getfile?taskID=3635149&name=build.log&offset=-4000)
so I guess upstream will come up with a solution soon.

-----

webkitgtk-1.6.1:

In file included
from /usr/i686-w64-mingw32/sys-root/mingw/include/glib-2.0/glib/gasyncqueue.h:34:0,

from /usr/i686-w64-mingw32/sys-root/mingw/include/glib-2.0/glib.h:34,

from ../Source/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h:32,
                 from ../Source/JavaScriptCore/wtf/unicode/Unicode.h:33,
                 from ../Source/JavaScriptCore/wtf/StringHasher.h:24,
                 from ../Source/JavaScriptCore/wtf/text/StringImpl.h:32,
                 from ../Source/JavaScriptCore/wtf/text/WTFString.h:28,
                 from ../Source/JavaScriptCore/wtf/DateMath.h:54,

from ../Source/JavaScriptCore/runtime/DateInstanceCache.h:29,

from ../Source/JavaScriptCore/runtime/JSGlobalData.h:34,

from ../Source/JavaScriptCore/interpreter/CallFrame.h:26,
                 from ../Source/JavaScriptCore/runtime/JSCell.h:27,

from ../Source/JavaScriptCore/runtime/JSAPIValueWrapper.h:26,
                 from ../Source/JavaScriptCore/API/APICast.h:29,
                 from ../Source/JavaScriptCore/API/JSBase.cpp:30:
/usr/i686-w64-mingw32/sys-root/mingw/include/glib-2.0/glib/gthread.h:51:16: error: 'union' tag used in naming 'struct _GMutex' [-fpermissive]
In file included from ../Source/JavaScriptCore/wtf/Platform.h:1123:0,
                 from ../Source/JavaScriptCore/config.h:30,
                 from ../Source/JavaScriptCore/API/JSBase.cpp:26:
../Source/JavaScriptCore/wtf/gobject/GTypedefs.h:55:16: note: 'struct
_GMutex' was previously declared here

This is a compatibility issue with glib2. See
https://bugs.webkit.org/show_bug.cgi?id=69840 for more details.
Unfortunately the ticket mentions that the proposed patch will break
webkitgtk for Win32, so more research is required to find out if the
issues are already resolved by now.

-----

Could anybody shed some light about the issues which were
encountered during this mass rebuild? Especially the errno
codes looks like a serious issue to me.

Kind regards,

Erik van Pienbroek





More information about the mingw mailing list