[Driver] Don't pass -Z to ld for ELF platforms (#69120)
commit993e839480449de63aefb1a1ae9142eefed5e7a6
authorFangrui Song <i@maskray.me>
Mon, 16 Oct 2023 02:12:35 +0000 (15 19:12 -0700)
committerGitHub <noreply@github.com>
Mon, 16 Oct 2023 02:12:35 +0000 (15 19:12 -0700)
tree2f73d0dd70c44a1aab6f5b78ce2649b5309e96a1
parent0ae4622126a2ea66de8f40b9366d486725529a82
[Driver] Don't pass -Z to ld for ELF platforms (#69120)

-Z is an Apple ld64 option. ELF linkers don't recognize -Z, except
OpenBSD which patched GNU ld to add -Z for zmagic (seems unused)

> -Z Produce 'Standard' executables, disables Writable XOR Executable
features in resulting binaries.

Some `ToolChain`s have -Z due to copy-and-paste mistakes.
clang/lib/Driver/ToolChains/BareMetal.cpp
clang/lib/Driver/ToolChains/CSKYToolChain.cpp
clang/lib/Driver/ToolChains/FreeBSD.cpp
clang/lib/Driver/ToolChains/Haiku.cpp
clang/lib/Driver/ToolChains/MinGW.cpp
clang/lib/Driver/ToolChains/NetBSD.cpp
clang/lib/Driver/ToolChains/OpenBSD.cpp
clang/lib/Driver/ToolChains/RISCVToolchain.cpp
clang/test/Driver/openbsd.c