diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 8a9bd3ecb4d..c8e3d8b4cc8 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -252,10 +252,10 @@ stdenv.mkDerivation { # some linkers on some platforms don't support specific -z flags hardening_unsupported_flags="" - if [[ "$($ldPath/ld -z now 2>&1 || true)" =~ "unknown option" ]]; then + if [[ "$($ldPath/ld -z now 2>&1 || true)" =~ un(recognized|known)\ option ]]; then hardening_unsupported_flags+=" bindnow" fi - if [[ "$($ldPath/ld -z relro 2>&1 || true)" =~ "unknown option" ]]; then + if [[ "$($ldPath/ld -z relro 2>&1 || true)" =~ un(recognized|known)\ option ]]; then hardening_unsupported_flags+=" relro" fi