bintools-wrapper: Don't pass -z to lld targeting Windows

This commit is contained in:
Shea Levy 2022-05-03 09:36:46 -04:00
parent dee9af9323
commit 4c0d5f80fc
No known key found for this signature in database
GPG Key ID: 5C0BD6957D86FE27

View File

@ -335,6 +335,11 @@ stdenv.mkDerivation {
echo "-arch ${targetPlatform.darwinArch}" >> $out/nix-support/libc-ldflags echo "-arch ${targetPlatform.darwinArch}" >> $out/nix-support/libc-ldflags
'' ''
# lld's MinGW driver (e.g. `ld.lld -m i386pep`) does not support the `-z` flag.
+ optionalString (targetPlatform.isWindows && isLld) ''
hardening_unsupported_flags+=" relro bindnow"
''
## ##
## GNU specific extra strip flags ## GNU specific extra strip flags
## ##