config: compensate for bug in Solaris cc drivers, which can remove /dev/null
authorAndy Polyakov <appro@openssl.org>
Tue, 13 Mar 2012 19:22:26 +0000 (19:22 +0000)
committerAndy Polyakov <appro@openssl.org>
Tue, 13 Mar 2012 19:22:26 +0000 (19:22 +0000)
[from HEAD,1.0.1]

config

diff --git a/config b/config
index cf64ec563e61c5c0a2651c0745a06e3d15cd4138..2cb4613a408591b4d4b182694b3744ec2eddda74 100755 (executable)
--- a/config
+++ b/config
@@ -825,9 +825,11 @@ esac
 #  options="$options -DATALLA"
 #fi
 
-($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
- grep \\--noexecstack) 2>&1 > /dev/null && \
+if expr "$options" : '.*no\-asm' > /dev/null; then :; else
+  sh -c "$CROSS_COMPILE${CC:-gcc} -Wa,--help -c -o /tmp/null.$$.o -x assembler /dev/null && rm /tmp/null.$$.o" 2>&1 | \
+  grep \\--noexecstack >/dev/null && \
   options="$options -Wa,--noexecstack"
+fi
 
 # gcc < 2.8 does not support -march=ultrasparc
 if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]