diff options
author | Bernhard Rosenkraenzer <bero@arklinux.ch> | 2011-03-21 11:19:36 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-03-21 11:21:12 (GMT) |
commit | e6b61b98f46918d2770a0147a42d10f0a0e18ca8 (patch) | |
tree | 099fce2d8b8ade4aa6ec646bb4dba9eb592e77e0 /projects.pro | |
parent | 312a46e052dd596d620437f1f5dde0ed5b173c28 (diff) | |
download | Qt-e6b61b98f46918d2770a0147a42d10f0a0e18ca8.zip Qt-e6b61b98f46918d2770a0147a42d10f0a0e18ca8.tar.gz Qt-e6b61b98f46918d2770a0147a42d10f0a0e18ca8.tar.bz2 |
Fix endianness detection with gcc 4.6 -flto -fwhole-program
Trying to build Qt with gcc 4.6 and the -flto optimization enabled
fails at ./configure state because the endianness can't be detected.
With -flto in QMAKE_CFLAGS and -fwhole-program in QMAKE_LFLAGS_APP,
gcc 4.6 manages to compute msb_bigendian[1] == lsb_littleendian[1] at
build time and reduces main() to "return 1;", throwing away the bits
being looked for.
Treating the short[] arrays as "code" and trying to actually run them
prevents even the -fwhole-program optimizer from kicking them out, and
since the endian test isn't actually run, doesn't break anything.
Merge-request: 1130
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'projects.pro')
0 files changed, 0 insertions, 0 deletions