changeset 49521:25695fce1601

8200267: a.out created at top dir by Solaris build Reviewed-by: erikj
author ihse
date Tue, 03 Apr 2018 21:50:35 +0200
parents eaa925fc7f64
children 083318155ad1
files make/autoconf/toolchain.m4
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/make/autoconf/toolchain.m4	Tue Apr 03 10:01:04 2018 -0700
+++ b/make/autoconf/toolchain.m4	Tue Apr 03 21:50:35 2018 +0200
@@ -597,8 +597,9 @@
 
     # solstudio cc requires us to have an existing file to pass as argument,
     # but it need not be a syntactically correct C file, so just use
-    # ourself. :)
-    LINKER_VERSION_STRING=`$LD -Wl,-V $TOPDIR/configure 2>&1 | $HEAD -n 1 | $SED -e 's/ld: //'`
+    # ourself. :) The intermediate 'cat' is needed to stop ld from leaving
+    # a lingering a.out (!).
+    LINKER_VERSION_STRING=`$LD -Wl,-V $TOPDIR/configure 2>&1 | $CAT | $HEAD -n 1 | $SED -e 's/ld: //'`
     # Extract version number
     [ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \
         $SED -e 's/.* \([0-9][0-9]*\.[0-9][0-9]*\)-\([0-9][0-9]*\.[0-9][0-9]*\)/\1.\2/'` ]