Skip to content

Commit

Permalink
configure: try linking to detect stack-protector support
Browse files Browse the repository at this point in the history
Even if gcc accepts the -fstack-protector argument, it is possible that
the libssp support library is missing. Detect this by linking instead
of just compiling.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/arp-scan/0001-configure-try-linking-to-detect-stack-protector-supp.patch]
  • Loading branch information
ffontaine committed Mar 15, 2019
1 parent 6ed692a commit cbeda6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ AC_DEFUN([GCC_STACK_PROTECT_CC],[
AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector])
ssp_old_cflags="$CFLAGS"
CFLAGS="$CFLAGS -fstack-protector"
AC_TRY_COMPILE(,,, ssp_cc=no)
AC_TRY_LINK(,,, ssp_cc=no)
echo $ssp_cc
if test "X$ssp_cc" = "Xno"; then
CFLAGS="$ssp_old_cflags"
Expand All @@ -259,7 +259,7 @@ AC_DEFUN([GCC_STACK_PROTECT_CXX],[
AC_MSG_CHECKING([whether ${CXX} accepts -fstack-protector])
ssp_old_cxxflags="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fstack-protector"
AC_TRY_COMPILE(,,, ssp_cxx=no)
AC_TRY_LINK(,,, ssp_cxx=no)
echo $ssp_cxx
if test "X$ssp_cxx" = "Xno"; then
CXXFLAGS="$ssp_old_cxxflags"
Expand Down

0 comments on commit cbeda6a

Please sign in to comment.