aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-10-21 13:07:47 -0400
committerNick Mathewson <nickm@torproject.org>2013-10-21 13:07:47 -0400
commit21ac292820da5784cf3c87e77df57b7594071d09 (patch)
tree9d0bad038aeeaef805b7b059be3214d6a0e312b6 /configure.ac
parent17d368281ad374908fb019e29f3f012659be010c (diff)
downloadtor-21ac292820da5784cf3c87e77df57b7594071d09.tar
tor-21ac292820da5784cf3c87e77df57b7594071d09.tar.gz
Give a better warning when stack protection breaks linking.
Fix for 9948; patch from Benedikt Gollatz.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 77767c52a..f1fa8812f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -589,7 +589,16 @@ if test x$enable_gcc_hardening != xno; then
if test x$have_clang = xyes; then
TOR_CHECK_CFLAGS(-Qunused-arguments)
fi
- TOR_CHECK_CFLAGS(-fstack-protector-all)
+ TOR_CHECK_CFLAGS(-fstack-protector-all, also_link)
+ AS_VAR_PUSHDEF([can_compile], [tor_cv_cflags_-fstack-protector-all])
+ AS_VAR_PUSHDEF([can_link], [tor_can_link_-fstack-protector-all])
+ AS_VAR_IF(can_compile, [yes],
+ AS_VAR_IF(can_link, [yes],
+ [],
+ AC_MSG_ERROR([We tried to build with stack protection; it looks like your compiler supports it but your libc does not provide it. Are you missing libssp? (You can --disable-gcc-hardening to ignore this error.)]))
+ )
+ AS_VAR_POPDEF([can_link])
+ AS_VAR_POPDEF([can_compile])
TOR_CHECK_CFLAGS(-Wstack-protector)
TOR_CHECK_CFLAGS(-fwrapv)
TOR_CHECK_CFLAGS(--param ssp-buffer-size=1)