c40e03
From db7947e144d10c15468991cad50315b70f2609d5 Mon Sep 17 00:00:00 2001
c40e03
From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= <bb@sernet.de>
c40e03
Date: Mon, 4 Dec 2017 10:49:19 +0100
c40e03
Subject: [PATCH 1/2] third_party: Link th aesni-intel library with -z
c40e03
 noexecstack
c40e03
MIME-Version: 1.0
c40e03
Content-Type: text/plain; charset=UTF-8
c40e03
Content-Transfer-Encoding: 8bit
c40e03
c40e03
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13174
c40e03
c40e03
Signed-off-by: Björn Baumbach <bb@sernet.de>
c40e03
Reviewed-by: Andreas Schneider <asn@samba.org>
c40e03
---
c40e03
 third_party/aesni-intel/wscript | 3 +++
c40e03
 1 file changed, 3 insertions(+)
c40e03
c40e03
diff --git a/third_party/aesni-intel/wscript b/third_party/aesni-intel/wscript
c40e03
index eb92d6626fe..0ccd9eb1e5b 100644
c40e03
--- a/third_party/aesni-intel/wscript
c40e03
+++ b/third_party/aesni-intel/wscript
c40e03
@@ -12,6 +12,8 @@ def configure(conf):
c40e03
                 raise Utils.WafError('--aes-accel=intelaesni selected and non x86_64 CPU')
c40e03
         else:
c40e03
             raise Utils.WafError('--aes-accel=intelaesni selected and compiler rejects -Wp,-E,-lang-asm')
c40e03
+        if not conf.CHECK_LDFLAGS('-Wl,-z,noexecstack'):
c40e03
+            raise Utils.WafError('--aes-accel=intelaesni selected and linker rejects -z noexecstack')
c40e03
 
c40e03
 def build(bld):
c40e03
     if not bld.CONFIG_SET('HAVE_AESNI_INTEL'):
c40e03
@@ -20,4 +22,5 @@ def build(bld):
c40e03
     bld.SAMBA_LIBRARY('aesni-intel',
c40e03
         source='aesni-intel_asm.c',
c40e03
         cflags='-Wp,-E,-lang-asm',
c40e03
+        ldflags='-Wl,-z,noexecstack',
c40e03
         private_library=True)
c40e03
-- 
c40e03
2.15.0
c40e03
c40e03
c40e03
From ded56e00f81614e128301d75e38e4b692a712cc4 Mon Sep 17 00:00:00 2001
c40e03
From: Andreas Schneider <asn@samba.org>
c40e03
Date: Mon, 4 Dec 2017 11:00:10 +0100
c40e03
Subject: [PATCH 2/2] third_party: Fix a typo in the option name
c40e03
c40e03
Signed-off-by: Andreas Schneider <asn@samba.org>
c40e03
---
c40e03
 third_party/aesni-intel/wscript | 6 +++---
c40e03
 1 file changed, 3 insertions(+), 3 deletions(-)
c40e03
c40e03
diff --git a/third_party/aesni-intel/wscript b/third_party/aesni-intel/wscript
c40e03
index 0ccd9eb1e5b..f0723a52501 100644
c40e03
--- a/third_party/aesni-intel/wscript
c40e03
+++ b/third_party/aesni-intel/wscript
c40e03
@@ -9,11 +9,11 @@ def configure(conf):
c40e03
                 print("Compiling with Intel AES instructions")
c40e03
                 conf.DEFINE('HAVE_AESNI_INTEL', 1)
c40e03
             else:
c40e03
-                raise Utils.WafError('--aes-accel=intelaesni selected and non x86_64 CPU')
c40e03
+                raise Utils.WafError('--accel-aes=intelaesni selected and non x86_64 CPU')
c40e03
         else:
c40e03
-            raise Utils.WafError('--aes-accel=intelaesni selected and compiler rejects -Wp,-E,-lang-asm')
c40e03
+            raise Utils.WafError('--accel-aes=intelaesni selected and compiler rejects -Wp,-E,-lang-asm')
c40e03
         if not conf.CHECK_LDFLAGS('-Wl,-z,noexecstack'):
c40e03
-            raise Utils.WafError('--aes-accel=intelaesni selected and linker rejects -z noexecstack')
c40e03
+            raise Utils.WafError('--accel-aes=intelaesni selected and linker rejects -z noexecstack')
c40e03
 
c40e03
 def build(bld):
c40e03
     if not bld.CONFIG_SET('HAVE_AESNI_INTEL'):
c40e03
-- 
c40e03
2.15.0
c40e03