INN commit: trunk (configure.ac)
INN Commit
rra at isc.org
Tue Jan 5 15:47:46 UTC 2021
Date: Tuesday, January 5, 2021 @ 07:47:46
Author: iulius
Revision: 10496
Fix build on AIX with -fstack-protector-strong
Though the compiler accepts -fstack-protector-strong, the build fails
because of either "Undefined symbol: __stack_chk_guard" or
"library libssp_nonshared not found" errors, depending on whether
the -fstack-protector-strong flag is also given for linking.
Modified:
trunk/configure.ac
--------------+
configure.ac | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
Modified: configure.ac
===================================================================
--- configure.ac 2021-01-05 15:07:06 UTC (rev 10495)
+++ configure.ac 2021-01-05 15:47:46 UTC (rev 10496)
@@ -701,6 +701,10 @@
[CC_WARNINGS=`echo "$CC_WARNINGS" | sed 's/-Wredundant-decls //'`])
dnl Add hardening build flags, if supported by the compiler.
+dnl Solaris has a separate libssp, so -fstack-protector-strong also has
+dnl to be passed to the linker. And we assume that if the linker does not
+dnl accept -fstack-protector-strong, the build is likely to fail (like on AIX
+dnl where libssp_nonshared may not be present).
AS_IF([test x"$inn_enable_hardening_flags" = xyes],
[INN_PROG_CC_FLAG([-fPIE], [CFLAGS="${CFLAGS} -fPIE"
CC_WARNINGS="${CC_WARNINGS} -fPIE"
@@ -711,7 +715,9 @@
CC_WARNINGS="${CC_WARNINGS} -fstack-protector-strong"],
[])
INN_PROG_LD_FLAG([-fstack-protector-strong],
- [LDFLAGS="${LDFLAGS} -fstack-protector-strong"], [])
+ [LDFLAGS="${LDFLAGS} -fstack-protector-strong"],
+ [CFLAGS=`echo "${CFLAGS}" | sed 's/ -fstack-protector-strong//'`
+ CC_WARNINGS=`echo "${CC_WARNINGS}" | sed 's/ -fstack-protector-strong//'`])
INN_PROG_LD_FLAG([-Wl,-z,relro],
[LDFLAGS="${LDFLAGS} -Wl,-z,relro"], [])
INN_PROG_LD_FLAG([-Wl,-z,now],
More information about the inn-committers
mailing list