mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
share/mk: Pass -znoexecstack to ld.bfd when linking libraries and programs.
lld assumes -znoexecstack by default whereas ld.bfd still defaults to -zexecstack in the absence of .note.GNU-stack annotations. Adding the flags centrally avoids having to patch various libraries in the tree as one-offs (e.g. OpenSSL 3 is the current thing generating new warnings with ld.bfd). Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D41120
This commit is contained in:
parent
59dc489a7e
commit
92053e4f8a
|
@ -95,6 +95,8 @@ LDFLAGS+= -Wl,-zretpolineplt
|
|||
.warning Retpoline requested but not supported by compiler or linker
|
||||
.endif
|
||||
.endif
|
||||
# LLD sensibly defaults to -znoexecstack, so do the same for BFD
|
||||
LDFLAGS.bfd+= -Wl,-znoexecstack
|
||||
|
||||
# Initialize stack variables on function entry
|
||||
.if ${MK_INIT_ALL_ZERO} == "yes"
|
||||
|
|
|
@ -68,6 +68,8 @@ LDFLAGS+= -Wl,-zretpolineplt
|
|||
.warning Retpoline requested but not supported by compiler or linker
|
||||
.endif
|
||||
.endif
|
||||
# LLD sensibly defaults to -znoexecstack, so do the same for BFD
|
||||
LDFLAGS.bfd+= -Wl,-znoexecstack
|
||||
|
||||
# Initialize stack variables on function entry
|
||||
.if ${MK_INIT_ALL_ZERO} == "yes"
|
||||
|
|
Loading…
Reference in a new issue