On 09/06/2012 01:00 PM, Mike Frysinger wrote: > if a package doesn't happen to include stddef.h before trying to do > AC_CHECK_ALIGNOF, the current cross-compile fallback fails with newer > gcc. > > for example, see the attached generated conftest.c (taken from recent > glib versions) where it does: > AC_CHECK_TYPE([guint32],,,[typedef unsigned $gint32 guint32;]) > AC_CHECK_ALIGNOF([guint32], [AC_INCLUDES_DEFAULT > typedef unsigned $gint32 guint32;]) > > compiling this gcc-4.5+ fails (checked 4.4.7, 4.5.3, 4.6.3, and 4.7.1): > $ gcc -O2 conftest.c > conftest.c: In function ‘main’: > conftest.c:216:12: error: storage size of ‘test_array’ isn’t constant
Thanks for the analysis. > > if, however, we happen to pull in the stddef.h from gcc which now > includes an offsetof definition itself (which uses a builtin), > everything works nicely: > $ gcc -O2 conftest.c -DSTDC_HEADERS > > perhaps one fix would be for AC_CHECK_ALIGNOF to require AC_STDC_HEADERS ? Yes, that sounds reasonable. Would you like to take the first shot at writing the patch? -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature