Set Security flags default enable (#194)

AMD-Internal: [CPUPL-7426]
This commit is contained in:
Sharma, Shubham
2025-09-18 10:29:08 +05:30
committed by GitHub
parent e3b22f495e
commit c9d4bb6778
3 changed files with 8 additions and 8 deletions

View File

@@ -1006,10 +1006,10 @@ set(LIBMEMKIND -lmemkind)
# Default linker flags.
# Security hardening flags :
# Default (no user override): DISABLED.
# Enable: -DENABLE_SECURITY_FLAGS=ON (or =1/TRUE) : enabled
# Disable: -DENABLE_SECURITY_FLAGS=OFF (or =0/FALSE) : disabled (default)
option(ENABLE_SECURITY_FLAGS "Enable addition of compiler/linker security hardening flags" OFF)
# Default (no user override): ENABLED.
# Enable: -DENABLE_SECURITY_FLAGS=ON (or =1/TRUE) : enabled (default)
# Disable: -DENABLE_SECURITY_FLAGS=OFF (or =0/FALSE) : disabled
option(ENABLE_SECURITY_FLAGS "Enable addition of compiler/linker security hardening flags" ON)
set(SECURITY_FLAGS_ENABLED ${ENABLE_SECURITY_FLAGS})
if(SECURITY_FLAGS_ENABLED)

View File

@@ -582,7 +582,7 @@ endif
# rule: if --disable-system is given at configure-time, LIBPTHREAD is empty.
LDFLAGS := $(LDFLAGS_PRESET) $(LIBM) $(LIBPTHREAD) $(STDCXX)
SECURITY_FLAGS_ENABLED := no
SECURITY_FLAGS_ENABLED := yes
# If configure provided MK_ENABLE_SECURITY_FLAGS, honor it first.
ifeq ($(MK_ENABLE_SECURITY_FLAGS),no)
SECURITY_FLAGS_ENABLED := no

6
configure vendored
View File

@@ -404,9 +404,9 @@ print_usage()
echo " "
echo " --enable-security-flags, --disable-security-flags"
echo " "
echo " Enable (disabled by default) addition of compiler and linker"
echo " Disable (Enabled by default) addition of compiler and linker"
echo " security hardening flags (e.g. -D_FORTIFY_SOURCE=2 -fstack-protector-strong"
echo " and -Wl,-z,relro -Wl,-z,now on ELF platforms). Disabling omits them."
echo " and -Wl,-z,relro -Wl,-z,now on ELF platforms)."
echo " "
echo " --enable-blis-arch-type, --disable-blis-arch-type"
echo " "
@@ -2188,7 +2188,7 @@ main()
enable_memkind='' # The default memkind value is determined later on.
enable_aocl_dynamic='yes'
enable_security_flags='no'
enable_security_flags='yes'
force_version='no'
complex_return='default'
disable_blis_arch_type='unset'