[56/62] make.sh: Add -fcf-protection for x86_64/i586

Message ID 20200816102953.3881-56-michael.tremer@ipfire.org
State Accepted
Commit 5eec0f21a6515e787ea8af0653c1048171d5d635
Headers
Series [01/62] bison: Update to 3.7.1 |

Commit Message

Michael Tremer Aug. 16, 2020, 10:29 a.m. UTC
  Instrument binaries to guard against ROP/JOP attacks.

This flag in only available on x86_64 and i586.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 make.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/make.sh b/make.sh
index fae75fdc9..99ac1bc85 100755
--- a/make.sh
+++ b/make.sh
@@ -146,14 +146,14 @@  configure_build() {
 			BUILDTARGET="${build_arch}-unknown-linux-gnu"
 			CROSSTARGET="${build_arch}-cross-linux-gnu"
 			BUILD_PLATFORM="x86"
-			CFLAGS_ARCH="-m64 -mtune=generic -fstack-clash-protection"
+			CFLAGS_ARCH="-m64 -mtune=generic -fstack-clash-protection -fcf-protection"
 			;;
 
 		i586)
 			BUILDTARGET="${build_arch}-pc-linux-gnu"
 			CROSSTARGET="${build_arch}-cross-linux-gnu"
 			BUILD_PLATFORM="x86"
-			CFLAGS_ARCH="-march=i586 -mtune=generic -fomit-frame-pointer"
+			CFLAGS_ARCH="-march=i586 -mtune=generic -fomit-frame-pointer -fcf-protection"
 			;;
 
 		aarch64)