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
Unknown Object (File)
Mon, May 18, 6:59 AM
Unknown Object (File)
Wed, May 13, 1:47 AM
Unknown Object (File)
Wed, May 13, 1:47 AM
Unknown Object (File)
Wed, May 13, 1:28 AM
Unknown Object (File)
Wed, May 13, 1:28 AM
Unknown Object (File)
Sat, Apr 25, 12:54 AM
Unknown Object (File)
Fri, Apr 24, 9:46 PM
Unknown Object (File)
Apr 24 2026, 7:25 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