From: Kevin O'Connor Date: Fri, 20 Nov 2009 14:19:28 +0000 (-0500) Subject: Test for broken gcc -combine on FC12. X-Git-Tag: rel-0.5.0~34 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3133e38211e61dc758d7e4e701eac7a556aa7067;p=seabios.git Test for broken gcc -combine on FC12. The Fedora Core 12 distro throws an internal compiler error due to a bug in gcc. Look for this case and avoid using -combine if found. --- diff --git a/tools/test-gcc.sh b/tools/test-gcc.sh index e189f25..3bb91e9 100755 --- a/tools/test-gcc.sh +++ b/tools/test-gcc.sh @@ -43,13 +43,30 @@ fi # Test if "-combine" works. On Ubuntu 8.04 the compiler doesn't work # correctly with combine and the "struct bregs" register due to the -# anonymous unions and structs. -mkdir -p out +# anonymous unions and structs. On Fedora Core 12 the compiler throws +# an internal compiler error when multiple files access global +# variables with debugging enabled. cat - > $TMPFILE1 < /dev/null 2>&1 +cat - > $TMPFILE2 < /dev/null 2>&1 if [ $? -eq 0 ]; then echo 0 else @@ -57,6 +74,12 @@ else echo 1 fi +# Also, on several compilers, -combine fails if code is emitted with a +# reference to an extern variable that is later found to be externally +# visible - the compiler does not mark those variables as global. +# This is being worked around by ordering the compile objects to avoid +# this case. + # Also, the Ubuntu 8.04 compiler has a bug causing corruption when the # "ebp" register is clobberred in an "asm" statement. The code has # been modified to not clobber "ebp" - no test is available yet.