mirror of
https://github.com/stefanberger/libtpms
synced 2026-02-04 13:16:19 +00:00
build-sys: Add probing for -fstack-protector
Add probing for -fstack-protector to the existing -fstack-protector-strong since not all platforms support either one of them. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
1de757972e
commit
3f8fbc831b
10
configure.ac
10
configure.ac
@ -284,10 +284,12 @@ AC_ARG_ENABLE([hardening],
|
||||
AS_HELP_STRING([--disable-hardening], [Disable hardening flags]))
|
||||
|
||||
if test "x$enable_hardening" != "xno"; then
|
||||
# Some versions of gcc fail with -Wstack-protector enabled
|
||||
TMP="$($CC -fstack-protector-strong $srcdir/include/libtpms/tpm_error.h 2>&1)"
|
||||
if echo $TMP | $GREP 'unrecognized command line option' >/dev/null; then
|
||||
HARDENING_CFLAGS="-fstack-protector "
|
||||
# Some versions of gcc fail with -Wstack-protector,
|
||||
# some with -Wstack-protector-strong enabled
|
||||
if ! $CC -fstack-protector-strong $srcdir/include/libtpms/tpm_error.h 2>/dev/null; then
|
||||
if $CC -fstack-protector $srcdir/include/libtpms/tpm_error.h 2>/dev/null; then
|
||||
HARDENING_CFLAGS="-fstack-protector "
|
||||
fi
|
||||
else
|
||||
HARDENING_CFLAGS="-fstack-protector-strong "
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user