[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AC_CHECK_ALIGNOF fails when cross-compiling with gcc >= 4.5
From: |
Michael Olbrich |
Subject: |
AC_CHECK_ALIGNOF fails when cross-compiling with gcc >= 4.5 |
Date: |
Wed, 25 Apr 2012 10:56:01 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Hi,
when cross-compiling with gcc >= 4.5 (I think), AC_CHECK_ALIGNOF fails to
detect the alignment. This happens because the compiler fails with "error:
storage size of ‘test_array’ isn’t constant" instead of succeeding.
Using __builtin_offsetof helps. Patch attached. I'm not quite sure when
__builtin_offsetof should be used, but it is used in the Linux kernel for
gcc 4.x, so I think this is correct.
Regards,
Michael
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
0001-fix-AC_CHECK_ALIGNOF-when-cross-compiling-with-gcc-4.patch
Description: Text Data
signature.asc
Description: Digital signature
- AC_CHECK_ALIGNOF fails when cross-compiling with gcc >= 4.5,
Michael Olbrich <=