Skip to content

Commit

Permalink
configure: Restore original endianness test
Browse files Browse the repository at this point in the history
Previously the bit pattern for the endianness test was declared as a
global, instead of a local, variable. This ensures that the pattern
appears unchanged in the object file and is not optimized out.
  • Loading branch information
DonDiego committed Mar 8, 2018
1 parent 80a4e6a commit dd7e63a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -4211,7 +4211,10 @@ done

check_cc pragma_deprecated "" '_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'

require_cc "endian test" "" "unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E'"
# The global variable ensures the bits appear unchanged in the object file.
test_cc <<EOF || die "endian test failed"
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF
od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian

check_gas() {
Expand Down

0 comments on commit dd7e63a

Please sign in to comment.