Page MenuHomeFreeBSD

share/mk: Pass -znoexecstack to ld.bfd when linking libraries and programs.
ClosedPublic

Authored by jhb on Jul 20 2023, 7:55 PM.
Tags
None
Referenced Files
F112795177: D41120.id.diff
Sat, Mar 22, 8:53 PM
F112740779: D41120.id124933.diff
Sat, Mar 22, 4:41 AM
Unknown Object (File)
Fri, Mar 21, 8:13 PM
Unknown Object (File)
Wed, Mar 19, 2:15 PM
Unknown Object (File)
Sun, Mar 16, 11:54 PM
Unknown Object (File)
Jan 27 2025, 4:54 PM
Unknown Object (File)
Jan 26 2025, 6:13 PM
Unknown Object (File)
Jan 16 2025, 11:23 AM

Details

Summary

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).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable