]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
Explicitely add hardening flags
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 3 May 2015 15:29:54 +0000 (11:29 -0400)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 3 May 2015 15:29:54 +0000 (11:29 -0400)
Add -z relro to the linker command line and -D_FORTIFY_SOURCE=2
for the preprocessor.

macros/cflags.macro

index 52a069a711be91f6cb5e173abde42657c5b03a85..7474c5db075d348f74fc1e0e936df610b9b550e9 100644 (file)
@@ -1,6 +1,6 @@
 
 # Export CFLAGS + CXXFLAGS
-GLOBAL_CFLAGS   = -O2 -g -pipe -Wall -Werror=format-security
+GLOBAL_CFLAGS   = -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -Werror=format-security
 GLOBAL_CFLAGS  += -fexceptions -fPIC -fstack-protector-strong --param=ssp-buffer-size=4
 GLOBAL_CFLAGS  += -grecord-gcc-switches
 
@@ -12,4 +12,4 @@ CFLAGS_armv7hl  = -march=armv7-a -mfpu=vfpv3-d16  -mfloat-abi=hard -mthumb
 export CFLAGS   = %{GLOBAL_CFLAGS} %{CFLAGS_%{DISTRO_ARCH}}
 export CXXFLAGS = %{CFLAGS}
 
-export LDFLAGS  =
+export LDFLAGS  = -Wl,-z,relro