Don't require RELRO and BIND_NOW for Darwin
Xcode's ld (at least ld64-302.3) doesn't support -z
This commit is contained in:
parent
601fc2414d
commit
c64108d1a0
|
@ -489,8 +489,14 @@ if test x$use_hardening != xno; then
|
||||||
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
|
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
|
||||||
],[AC_MSG_ERROR(Cannot enable -D_FORTIFY_SOURCE=2)])
|
],[AC_MSG_ERROR(Cannot enable -D_FORTIFY_SOURCE=2)])
|
||||||
|
|
||||||
|
if test x$BUILD_OS = xdarwin; then
|
||||||
|
# Xcode's ld (at least ld64-302.3) doesn't 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
|
||||||
AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"],[AC_MSG_ERROR(Cannot enable RELRO)])
|
AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"],[AC_MSG_ERROR(Cannot enable RELRO)])
|
||||||
AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"],[AC_MSG_ERROR(Cannot enable BIND_NOW)])
|
AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"],[AC_MSG_ERROR(Cannot enable BIND_NOW)])
|
||||||
|
fi
|
||||||
|
|
||||||
if test x$TARGET_OS != xwindows; then
|
if test x$TARGET_OS != xwindows; then
|
||||||
# All windows code is PIC, forcing it on just adds useless compile warnings
|
# All windows code is PIC, forcing it on just adds useless compile warnings
|
||||||
|
|
Loading…
Reference in New Issue