Add security compiling option in Makefile.am to support
RELRO, SC, and FORTIFY.
Change-Id: I5d6c052b897cc392d4c2a1f62a5ac60952c2927e
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
-DPREFIX=\""$(prefix)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DVERSION=\""$(VERSION)"\" \
-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_LDFLAGS = -pie \
+ -Wl,-z,relro
if ENABLE_FUZZ_TARGETS
AM_CFLAGS += -fsanitize=fuzzer-no-link
if ENABLE_FUZZ_TARGETS
AM_CFLAGS += -fsanitize=fuzzer-no-link