]> git.pond.sub.org Git - empserver/commit
configure: Use -fstack-protector-strong when available
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 22 Nov 2015 09:38:24 +0000 (10:38 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 5 Dec 2015 12:19:38 +0000 (13:19 +0100)
commit9645caf6ffdc4bba14bf957b3a9c8d0f1d4bd126
tree8fc2790841f883618cb9d96a8a9bc69035169043
parent41263cf8c94c1b9bab8e27c4c830dc6cdd605297
configure: Use -fstack-protector-strong when available

Testing whether the compiler supports it is a bit tricky.

The obvious AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
doesn't suffice, since some ports of the GNU toolchain reportedly pass
this test, then fail to link.  That's because the compiler accepts the
flag, duly emits references to helper code in libc, but libc doesn't
provide, and linking fails.

Instead, use AX_APPEND_LINK_FLAGS with an input source that makes the
compiler emit the extra stack checking code.  This requires the latest
version from the autoconf-archive, so update m4/ax* to commit e3d948b.
Also update m4/my_append_compile_flags.m4 to keep it in sync with
upstream's ax_append_compile_flags.m4.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
configure.ac
m4/ax_append_flag.m4
m4/ax_append_link_flags.m4 [new file with mode: 0644]
m4/ax_check_link_flag.m4 [new file with mode: 0644]
m4/my_append_compile_flags.m4