Fix cross-builds from macOS
The macOS linker does not support -zrelro/-znorelro. Since it is only
used to for build tools that run on the host, and WITH_RELRO or
WITHOUT_RELRO does not matter there, just skip the option.
Reviewed by: markj
Fixes: 2f3a961487
("Add RELRO build knob, default to enabled")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35589
This commit is contained in:
parent
1e824ee84f
commit
7927452ac4
@ -79,11 +79,13 @@ TAG_ARGS= -T ${TAGS:[*]:S/ /,/g}
|
||||
.if ${MK_BIND_NOW} != "no"
|
||||
LDFLAGS+= -Wl,-znow
|
||||
.endif
|
||||
.if ${LINKER_TYPE} != "macos"
|
||||
.if ${MK_RELRO} == "no"
|
||||
LDFLAGS+= -Wl,-znorelro
|
||||
.else
|
||||
LDFLAGS+= -Wl,-zrelro
|
||||
.endif
|
||||
.endif
|
||||
.if ${MK_RETPOLINE} != "no"
|
||||
.if ${COMPILER_FEATURES:Mretpoline} && ${LINKER_FEATURES:Mretpoline}
|
||||
CFLAGS+= -mretpoline
|
||||
|
@ -41,11 +41,13 @@ MK_DEBUG_FILES= no
|
||||
.if ${MK_BIND_NOW} != "no"
|
||||
LDFLAGS+= -Wl,-znow
|
||||
.endif
|
||||
.if ${LINKER_TYPE} != "macos"
|
||||
.if ${MK_RELRO} == "no"
|
||||
LDFLAGS+= -Wl,-znorelro
|
||||
.else
|
||||
LDFLAGS+= -Wl,-zrelro
|
||||
.endif
|
||||
.endif
|
||||
.if ${MK_PIE} != "no"
|
||||
# Static PIE is not yet supported/tested.
|
||||
.if !defined(NO_SHARED) || ${NO_SHARED:tl} == "no"
|
||||
|
Loading…
Reference in New Issue
Block a user