[openssl-commits] [openssl] master update

Andy Polyakov appro at openssl.org
Sat May 5 18:49:11 UTC 2018


The branch master has been updated
       via  41d6e0f36e43a2b6f555977147e05f0fdec87f56 (commit)
       via  0ad4078cd604797eec4b8922f169da5c2a1a16d3 (commit)
      from  0d94212a046e87fafea6e83e8ea2b2a58db49979 (commit)


- Log -----------------------------------------------------------------
commit 41d6e0f36e43a2b6f555977147e05f0fdec87f56
Author: Andy Polyakov <appro at openssl.org>
Date:   Fri May 4 14:25:45 2018 +0200

    Configure: pass more suitable argument to compiler_predefined().
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/6174)

commit 0ad4078cd604797eec4b8922f169da5c2a1a16d3
Author: Andy Polyakov <appro at openssl.org>
Date:   Fri May 4 14:06:44 2018 +0200

    Configure: move --noexecstack probe to Configure.
    
    config probe doesn't work in cross-compile scenarios or with clang.
    In addition consolidate -Qunused-arguments handling.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/6174)

-----------------------------------------------------------------------

Summary of changes:
 Configurations/15-android.conf |  2 +-
 Configure                      | 43 ++++++++++++++++++++++++++++--------------
 config                         |  8 --------
 3 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/Configurations/15-android.conf b/Configurations/15-android.conf
index 9df4d94..ddd642a 100644
--- a/Configurations/15-android.conf
+++ b/Configurations/15-android.conf
@@ -65,7 +65,7 @@
             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
diff --git a/Configure b/Configure
index ffc5fe5..6650703 100755
--- a/Configure
+++ b/Configure
@@ -1407,7 +1407,7 @@ unless ($disabled{asm}) {
     }
 }
 
-my %predefined = compiler_predefined($config{CC});
+my %predefined = compiler_predefined($config{CROSS_COMPILE}.$config{CC});
 
 # Check for makedepend capabilities.
 if (!$disabled{makedepend}) {
@@ -1427,6 +1427,27 @@ if (!$disabled{makedepend}) {
     }
 }
 
+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 ###################################################
 
@@ -1468,11 +1489,6 @@ if (defined($config{api})) {
     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;
@@ -3052,28 +3068,27 @@ sub run_dofile
 
 sub compiler_predefined {
     state %predefined;
-    my $default_compiler = shift;
+    my $cc = shift;
 
     return () if $^O eq 'VMS';
 
-    die 'compiler_predefined called without a default compiler'
-        unless $default_compiler;
+    die 'compiler_predefined called without a compiler command'
+        unless $cc;
 
-    if (! $predefined{$default_compiler}) {
-        my $cc = "$config{CROSS_COMPILE}$default_compiler";
+    if (! $predefined{$cc}) {
 
-        $predefined{$default_compiler} = {};
+        $predefined{$cc} = {};
 
         # collect compiler pre-defines from gcc or gcc-alike...
         open(PIPE, "$cc -dM -E -x c /dev/null 2>&1 |");
         while (my $l = <PIPE>) {
             $l =~ m/^#define\s+(\w+(?:\(\w+\))?)(?:\s+(.+))?/ or last;
-            $predefined{$default_compiler}->{$1} = $2 // '';
+            $predefined{$cc}->{$1} = $2 // '';
         }
         close(PIPE);
     }
 
-    return %{$predefined{$default_compiler}};
+    return %{$predefined{$cc}};
 }
 
 sub which
diff --git a/config b/config
index a44cd21..b8adf34 100755
--- a/config
+++ b/config
@@ -840,14 +840,6 @@ if [ -n "$CONFIG_OPTIONS" ]; then
   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


More information about the openssl-commits mailing list