]> git.ipfire.org Git - pakfire.git/commitdiff
macros: Update CFLAGS
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 24 Nov 2022 21:52:23 +0000 (21:52 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 24 Nov 2022 21:52:23 +0000 (21:52 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
macros/cflags.macro

index 7b2f7fa043f94695f7f09fe62ae8ef8a538b5a76..b9405cb00b8a1673eb2e78a61ebb681078ccbf7a 100644 (file)
@@ -1,12 +1,34 @@
 
 # Export CFLAGS + CXXFLAGS
-GLOBAL_CFLAGS   = -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-GLOBAL_CFLAGS  += -fPIC -fstack-protector-strong --param=ssp-buffer-size=4
-GLOBAL_CFLAGS  += -grecord-gcc-switches -fdebug-prefix-map=%{DIR_SRC}=%{debugsourcedir}
+GLOBAL_CFLAGS = -O2 -g
+
+# Enable all compiler warnings
+GLOBAL_CFLAGS += -Wall
+
+# Fortify Source
+GLOBAL_CFLAGS += -Wp,-U_FORTIFY_SOURCE-Wp,-D_FORTIFY_SOURCE=3
+
+# Build Position Independent Code
+GLOBAL_CFLAGS += -fPIC
+
+# Enable Stack Smashing Protection
+GLOBAL_CFLAGS += -fstack-protector-strong
+
+# Enable unwind tables
+GLOBAL_CFLAGS += -funwind-tables -fasynchronous-unwind-tables
+
+# Enable Stack Clash Protection
+GLOBAL_CFLAGS += -fstack-clash-protection
+
+# Tell the compiler where the source will be put
+GLOBAL_CFLAGS += -fdebug-prefix-map=%{DIR_SRC}=%{debugsourcedir}
+
+# Arch: x86_64
+CFLAGS_x86_64 = -m64 -march=x86-64-v2 -mtune=generic
+
+# Arch: aarch64
+CFLAGS_aarch64 = -mbranch-protection=standard
 
-CFLAGS_x86_64   = -m64 -mtune=generic
-# Disabled for now because the version of GCC we have does not support this switch
-#CFLAGS_aarch64  = -fstack-clash-protection
 export CFLAGS   = %{GLOBAL_CFLAGS} %{CFLAGS_%{DISTRO_ARCH}}
 export CXXFLAGS = %{CFLAGS}