wafsamba: Also build libraries with RELRO protection
authorAndreas Schneider <asn@samba.org>
Fri, 19 Jun 2015 07:28:32 +0000 (09:28 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 25 Nov 2015 08:54:26 +0000 (09:54 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11346

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 893b5f81441bbc98ef403855ec8e2e39569479d2)

buildtools/wafsamba/wafsamba.py

index 188e5355d4d90324628213bc4e6bc6674a9978da..39d96059d55878a617719a7e0a74b0d33f079fd1 100644 (file)
@@ -239,6 +239,8 @@ def SAMBA_LIBRARY(bld, libname, source,
                                     bundled_extension, private_library)
 
     ldflags = TO_LIST(ldflags)
+    if bld.env['ENABLE_RELRO'] is True:
+        ldflags.extend(TO_LIST('-Wl,-z,relro,-z,now'))
 
     features = 'cc cshlib symlink_lib install_lib'
     if pyext: