From 4105c482a9099a782b8274c1cfa361aec57d0c2a Mon Sep 17 00:00:00 2001 From: Unsung Lee Date: Sat, 25 Nov 2023 21:14:47 +0900 Subject: [PATCH] Makefile: Add security compiling option (RELRO, SC, and FORTIFY) Add security compiling option in Makefile.am to support RELRO, SC, and FORTIFY. Change-Id: I5d6c052b897cc392d4c2a1f62a5ac60952c2927e Signed-off-by: Unsung Lee --- Makefile.am | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 16c0a4d..edbcab3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,10 +12,13 @@ AM_CPPFLAGS = \ -DPREFIX=\""$(prefix)"\" \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -DVERSION=\""$(VERSION)"\" \ - -DEXTERNAL_LUKS2_TOKENS_PATH=\"${EXTERNAL_LUKS2_TOKENS_PATH}\" -AM_CFLAGS = -Wall -fPIE + -DEXTERNAL_LUKS2_TOKENS_PATH=\"${EXTERNAL_LUKS2_TOKENS_PATH}\" \ + -fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -Wl,-z,relro +AM_CFLAGS = -Wall -fPIE \ + -fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -Wl,-z,relro AM_CXXFLAGS = -Wall -AM_LDFLAGS = -pie +AM_LDFLAGS = -pie \ + -Wl,-z,relro if ENABLE_FUZZ_TARGETS AM_CFLAGS += -fsanitize=fuzzer-no-link -- 2.7.4