Browse Source

configure: Don't require RELRO and BIND_NOW when cross-compiling

mingw-w64's ld (at least mingw-w64 4.0.4-2) appears to not support -z
pull/4/head
Jack Grigg 6 years ago
parent
commit
8d45f6e4e2
No known key found for this signature in database GPG Key ID: 1B8D649257DB0829
  1. 3
      configure.ac

3
configure.ac

@ -483,8 +483,9 @@ if test x$use_hardening != xno; then
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
],[AC_MSG_ERROR(Cannot enable -D_FORTIFY_SOURCE=2)])
if test x$BUILD_OS = xdarwin; then
if test x$BUILD_OS = xdarwin || test x$TARGET_OS = xwindows; then
# Xcode's ld (at least ld64-302.3) doesn't support -z
# mingw-w64's ld (at least mingw-w64 4.0.4-2) also appears to not support -z
AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"],[AC_MSG_WARN(Cannot enable RELRO)])
AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"],[AC_MSG_WARN(Cannot enable BIND_NOW)])
else

Loading…
Cancel
Save