Browse Source

configure: Check if the support library for stack protectors is available

Clang does support the -fstack-protector-strong flag, but that
in itself doesn't mean that the required support library actually
exists.
pull/68/head
Martin Storsjö 9 years ago
parent
commit
e43da3c83e
  1. 9
      configure.ac

9
configure.ac

@ -1121,12 +1121,21 @@ AH_BOTTOM([
AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
])
VLC_SAVE_FLAGS
AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
dnl Win32 requires linking to ssp for stack-protection
AS_IF([test "${SYS}" = "mingw32"], [
LDFLAGS="${LDFLAGS} -lssp"
AS_IF([test "${vlc_winstore_app}" != 1], [LDFLAGS="${LDFLAGS} -ladvapi32"])
AC_CACHE_CHECK([if linker supports stack protectors], [ac_cv_ld_ssp], [
AC_TRY_LINK([#include <stdio.h>],[char buf[100]; fgets(buf, sizeof(buf), stdin);], [
ac_cv_ld_ssp="yes"
], [
ac_cv_ld_ssp="no"
])
])
AS_IF([test "${ac_cv_ld_ssp}" = "no"], [VLC_RESTORE_FLAGS])
])
])

Loading…
Cancel
Save