Package: alljoyn-thin-client-1504 / 15.04b-2

hardening.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Author: Thorsten Alteholz <debian@alteholz.de>
Description: add hardening flags
Index: alljoyn-thin-client-1504/SConscript
===================================================================
--- alljoyn-thin-client-1504.orig/SConscript	2016-06-15 13:47:13.000000000 +0200
+++ alljoyn-thin-client-1504/SConscript	2016-06-15 13:47:36.000000000 +0200
@@ -136,13 +136,21 @@
         env.Append(LINKFLAGS=os.environ['CROSS_LINKFLAGS'].split())
 
     env['libs'] = ['rt', 'crypto', 'pthread']
+
     env.Append(CFLAGS=['-Wall',
                        '-pipe',
                        '-static',
                        '-funsigned-char',
                        '-Wpointer-sign',
                        '-Wimplicit-function-declaration',
+                       '-fPIE',
+                       '-fPIC',
+                       '-D_FORTIFY_SOURCE=2',
                        '-fno-strict-aliasing'])
+    env.Append(LINKFLAGS = ['-fPIE', '-pie', '-fPIC'])
+    env.Append(LINKFLAGS = ['-z', 'relro', '-z', 'now'])
+    env.Append(CPPFLAGS = ['-fPIE', '-fPIC', '-D_FORTIFY_SOURCE=2'])
+
     if env['VARIANT'] == 'debug':
         env.Append(CFLAGS='-g')
     else: