my ($api, $arch) = ($1, $2);
my $triarch = $triplet{$arch};
- my $cflags = "-Wa,--noexecstack";
+ my $cflags;
my $cppflags;
# see if there is NDK clang on $PATH
}
}
+if (!$disabled{asm}) {
+ # probe for -Wa,--noexecstack option...
+ if ($predefined{__clang__}) {
+ # clang has builtin assembler, which doesn't recognize --help,
+ # but it apparently recognizes the option in question on all
+ # supported platforms even when it's meaningless. In other words
+ # probe would fail, but probed option always accepted...
+ push @{$config{cflags}}, "-Wa,--noexecstack", "-Qunused-arguments";
+ } elsif ($^O ne 'VMS') {
+ my $cc = $config{CROSS_COMPILE}.$config{CC};
+ open(PIPE, "$cc -Wa,--help -c -o null.$$.o -x assembler /dev/null 2>&1 |");
+ while(<PIPE>) {
+ if (m/--noexecstack/) {
+ push @{$config{cflags}}, "-Wa,--noexecstack";
+ last;
+ }
+ }
+ close(PIPE);
+ unlink("null.$$.o");
+ }
+}
# Deal with bn_ops ###################################################
push @{$config{defines}}, $apiflag;
}
-if (defined($predefined{__clang__}) && !$disabled{asm}) {
- push @{$config{cflags}}, "-Qunused-arguments";
- push @{$config{cxxflags}}, "-Qunused-arguments" if $config{CXX};
-}
-
if ($strict_warnings)
{
my $wopt;
options="$options $CONFIG_OPTIONS"
fi
-if expr "$options" : '.*no\-asm' > /dev/null; then :; else
- if 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; then
- __CNF_CFLAGS="$__CNF_CFLAGS -Wa,--noexecstack"
- __CNF_CXXFLAGS="$__CNF_CXXFLAGS -Wa,--noexecstack"
- fi
-fi
-
# gcc < 2.8 does not support -march=ultrasparc
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
then