diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-10-21 13:07:47 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-10-21 13:07:47 -0400 |
commit | 21ac292820da5784cf3c87e77df57b7594071d09 (patch) | |
tree | 9d0bad038aeeaef805b7b059be3214d6a0e312b6 /acinclude.m4 | |
parent | 17d368281ad374908fb019e29f3f012659be010c (diff) | |
download | tor-21ac292820da5784cf3c87e77df57b7594071d09.tar.gz tor-21ac292820da5784cf3c87e77df57b7594071d09.zip |
Give a better warning when stack protection breaks linking.
Fix for 9948; patch from Benedikt Gollatz.
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index af1505156c..2943734143 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -43,6 +43,8 @@ AC_DEFUN([TOR_DEFINE_CODEPATH], ]) dnl 1:flags +dnl 2:also try to link (yes: non-empty string) +dnl will set yes or no in $tor_can_link_$1 (as modified by AS_VAR_PUSHDEF) AC_DEFUN([TOR_CHECK_CFLAGS], [ AS_VAR_PUSHDEF([VAR],[tor_cv_cflags_$1]) AC_CACHE_CHECK([whether the compiler accepts $1], VAR, [ @@ -51,6 +53,13 @@ AC_DEFUN([TOR_CHECK_CFLAGS], [ AC_TRY_COMPILE([], [return 0;], [AS_VAR_SET(VAR,yes)], [AS_VAR_SET(VAR,no)]) + if test x$2 != x; then + AS_VAR_PUSHDEF([can_link],[tor_can_link_$1]) + AC_TRY_LINK([], [return 0;], + [AS_VAR_SET(can_link,yes)], + [AS_VAR_SET(can_link,no)]) + AS_VAR_POPDEF([can_link]) + fi CFLAGS="$tor_saved_CFLAGS" ]) if test x$VAR = xyes; then |