From 4c0d5f80fcdef2024f73c584f7450a6f37ced8cd Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 3 May 2022 09:36:46 -0400 Subject: [PATCH] bintools-wrapper: Don't pass -z to lld targeting Windows --- pkgs/build-support/bintools-wrapper/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 2a1a8699485c..16a9a0c7b228 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -335,6 +335,11 @@ stdenv.mkDerivation { 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 ##