]> xenbits.xensource.com Git - seabios.git/commitdiff
test-gcc: do not truncate stderr
authorIan Campbell <ian.campbell@citrix.com>
Thu, 22 Mar 2012 15:25:24 +0000 (15:25 +0000)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 24 Mar 2012 15:45:06 +0000 (11:45 -0400)
Using "> /dev/fd/2" causes stderr to get truncated, which is mangles the log
file if the user happens to have redirected it there.

Use ">&2" instead which redirects to the already open stderr and doesn't
truncate it.

Reported-by: Tim Deegan <tim@xen.org>
Tested-by: Tim Deegan <tim@xen.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
tools/test-gcc.sh

index 935f211b0a2f6899846cfdb2a875c7f13534d6f0..05bae2957f5209e1a8fb7a8a68f7dac7c5ad1ad9 100755 (executable)
@@ -30,13 +30,13 @@ EOF
 $CC -O -g -c $TMPFILE1 -o $TMPFILE1o > /dev/null 2>&1
 $LD -T $TMPFILE1_ld $TMPFILE1o -o $TMPFILE2o > /dev/null 2>&1
 if [ $? -ne 0 ]; then
-    echo "The version of LD on this system does not properly handle" > /dev/fd/2
-    echo "alignments.  As a result, this project can not be built." > /dev/fd/2
-    echo "" > /dev/fd/2
-    echo "The problem may be the result of this LD bug report:" > /dev/fd/2
-    echo " http://sourceware.org/bugzilla/show_bug.cgi?id=12726" > /dev/fd/2
-    echo "" > /dev/fd/2
-    echo "Please update to a working version of binutils and retry." > /dev/fd/2
+    echo "The version of LD on this system does not properly handle" >&2
+    echo "alignments.  As a result, this project can not be built." >&2
+    echo "" >&2
+    echo "The problem may be the result of this LD bug report:" >&2
+    echo " http://sourceware.org/bugzilla/show_bug.cgi?id=12726" >&2
+    echo "" >&2
+    echo "Please update to a working version of binutils and retry." >&2
     echo -1
     exit 0
 fi
@@ -45,7 +45,7 @@ fi
 # support the whole-program optimization - detect that.
 $CC -fwhole-program -S -o /dev/null -xc /dev/null > /dev/null 2>&1
 if [ $? -ne 0 ]; then
-    echo "  Working around no -fwhole-program" > /dev/fd/2
+    echo "  Working around no -fwhole-program" >&2
     echo 2
     exit 0
 fi
@@ -69,7 +69,7 @@ EOF
 $CC -Os -c -fwhole-program $TMPFILE2 -o $TMPFILE2o > /dev/null 2>&1
 $CC -nostdlib -Os $TMPFILE1o $TMPFILE2o -o $TMPFILE3o > /dev/null 2>&1
 if [ $? -ne 0 ]; then
-    echo "  Working around non-functional -fwhole-program" > /dev/fd/2
+    echo "  Working around non-functional -fwhole-program" >&2
     echo 2
     exit 0
 fi
@@ -104,7 +104,7 @@ $CC -O -g -fwhole-program -combine -c $TMPFILE1 $TMPFILE2 -o $TMPFILE1o > /dev/n
 if [ $? -eq 0 ]; then
     echo 0
 else
-    echo "  Working around non-functional -combine" > /dev/fd/2
+    echo "  Working around non-functional -combine" >&2
     echo 1
 fi