From: Michael Tremer Date: Sun, 3 May 2015 15:29:54 +0000 (-0400) Subject: Explicitely add hardening flags X-Git-Tag: 0.9.27~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=037fe87c5b260f27cb57988f35d4fc7f1afa5416;p=pakfire.git Explicitely add hardening flags Add -z relro to the linker command line and -D_FORTIFY_SOURCE=2 for the preprocessor. --- diff --git a/macros/cflags.macro b/macros/cflags.macro index 52a069a71..7474c5db0 100644 --- a/macros/cflags.macro +++ b/macros/cflags.macro @@ -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