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
This commit is contained in:
Jack Grigg
2018-04-13 22:09:02 -06:00
parent b057754005
commit 8d45f6e4e2

View File

@@ -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