summaryrefslogtreecommitdiff
path: root/targets/buildtarget
diff options
context:
space:
mode:
authorMats Erik Andersson <mats.andersson@gisladisker.se>2008-08-27 22:25:55 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2008-08-27 22:25:55 +0000
commitb1b1d70d78791a0358258cc8e1aab39537a17a2a (patch)
tree710055e9b6629a5a5c3f2b44d64c1d14dde3ec3c /targets/buildtarget
parentec2bd53c3776e928a9c7e0b9e8a26886b5fc9182 (diff)
Capture output from 'ld --help', in order that the test
becomes meaningful. The linker puts help texts on stderr. Signed-off-by: Mats Erik Andersson <mats.andersson@gisladisker.se> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3543 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'targets/buildtarget')
-rwxr-xr-xtargets/buildtarget7
1 files changed, 6 insertions, 1 deletions
diff --git a/targets/buildtarget b/targets/buildtarget
index 2b3b83bfce..02694a2411 100755
--- a/targets/buildtarget
+++ b/targets/buildtarget
@@ -69,7 +69,12 @@ fi
rm -rf .$$.tmp
-if $CC -Wl,--help | grep -q build-id; then
+# The linker output fd depends on the gcc version.
+# 1) 'ld-2.15 --help' and 'gcc-4.0 -Wl,--help' use STDOUT.
+# 2) 'gcc-3.3 --help' and 'gcc-3.4 -Wl,--help' use STDERR.
+# Thus older versions of GCC (presumably 3.x) implement a redirection of
+# output to stderr. Re-redirect stderr to stdout to work always.
+if $CC -Wl,--help 2>&1 | grep -q build-id; then
EXTRA_LFLAGS="$EXTRA_LFLAGS -Wl,--build-id=none"
fi