[clang] [Driver] Don't pass -Z to ld for ELF platforms (PR #69120)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 15 19:09:44 PDT 2023


MaskRay wrote:

> OpenBSD has a -Z flag for our BFD linker.
> 
> `-Z Produce 'Standard' executables, disables Writable XOR Executable features in resulting binaries.`
> 
> [openbsd/src at 0abdc37](https://github.com/openbsd/src/commit/0abdc3723b5d33dde698ab941325edec2819c128) [openbsd/src at 58cb065](https://github.com/openbsd/src/commit/58cb065838343f5d972d625775790ebb89f56d88) [openbsd/src at 0bd5fc2](https://github.com/openbsd/src/commit/0bd5fc2a33971fd1cca748eda19e75844fa9c27a)
> 
> But it was never ported to our copy of LLD, which is what almost all of our Clang switched archs use, plus I can't seem to find any use of the flag anywhere nowadays.

Thanks for the info! Interesting. I'll update the description.

Another question is whether we want to use `clang -Z` or `clang -Wl,-Z`. For newer options we probably should recommend `-Wl,` more.

https://github.com/llvm/llvm-project/pull/69120


More information about the cfe-commits mailing list