8200267: a.out created at top dir by Solaris build
authorihse
Tue, 03 Apr 2018 21:50:35 +0200
changeset 49514 25695fce1601
parent 49513 eaa925fc7f64
child 49515 083318155ad1
8200267: a.out created at top dir by Solaris build Reviewed-by: erikj
make/autoconf/toolchain.m4
--- 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/'` ]