INN commit: branches/2.6 (

INN Commit rra at
Tue Jan 5 16:06:30 UTC 2021

    Date: Tuesday, January 5, 2021 @ 08:06:30
  Author: iulius
Revision: 10497

Add -fstack-protector-strong for linking if recognized

Building innd on Solaris fails if the compiler does not have
amongst its flags -fstack-protector-strong for linking.

Undefined                       first referenced
 symbol                             in file
__stack_chk_fail                    art.o
__stack_chk_guard                   art.o
ld: fatal: symbol referencing errors

Also, if the compiler does not support -fstack-protector-strong
for linking, assume it will not work, and remove that flag even
for compiling (AIX typically does not have libssp_nonshared). 


--------------+ |    8 ++++++++
 1 file changed, 8 insertions(+)

---	2021-01-05 15:47:46 UTC (rev 10496)
+++	2021-01-05 16:06:30 UTC (rev 10497)
@@ -622,6 +622,10 @@
 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],
                                 CC_WARNINGS="${CC_WARNINGS} -fPIE"
@@ -631,6 +635,10 @@
                       [CFLAGS="${CFLAGS} -fstack-protector-strong"
                        CC_WARNINGS="${CC_WARNINGS} -fstack-protector-strong"],
+     INN_PROG_LD_FLAG([-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//'`])
                       [LDFLAGS="${LDFLAGS} -Wl,-z,relro"], [])

More information about the inn-committers mailing list