From 04ba4d1a3bbde89a862a5cfd03277aba7a51ff0b Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 26 Oct 2024 22:21:08 +0100 Subject: [PATCH] =?UTF-8?q?bintools-wrapper:=20fix=20late=E2=80=90bound=20?= =?UTF-8?q?command=20references?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ports 985072e2ce4afa4201b49a20154fcc888aaccec5 to bintools-wrapper. Co-authored-by: Artturin Co-authored-by: IlyaNiklyaev --- pkgs/build-support/bintools-wrapper/default.nix | 2 ++ pkgs/build-support/bintools-wrapper/ld-wrapper.sh | 4 ++-- pkgs/test/cc-wrapper/default.nix | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index a2a0736c2221..05d5f0d39664 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -403,6 +403,8 @@ stdenvNoCC.mkDerivation { # TODO(@sternenseemann): rename env var via stdenv rebuild shell = (getBin runtimeShell + runtimeShell.shellPath or ""); gnugrep_bin = optionalString (!nativeTools) gnugrep; + rm = if nativeTools then "rm" else lib.getExe' coreutils "rm"; + mktemp = if nativeTools then "mktemp" else lib.getExe' coreutils "mktemp"; wrapperName = "BINTOOLS_WRAPPER"; inherit dynamicLinker targetPrefix suffixSalt coreutils_bin; inherit bintools_bin libc_bin libc_dev libc_lib; diff --git a/pkgs/build-support/bintools-wrapper/ld-wrapper.sh b/pkgs/build-support/bintools-wrapper/ld-wrapper.sh index 7e00d02b0374..9b2f752af5fe 100644 --- a/pkgs/build-support/bintools-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/bintools-wrapper/ld-wrapper.sh @@ -251,8 +251,8 @@ PATH="$path_backup" # Old bash workaround, see above. if (( "${NIX_LD_USE_RESPONSE_FILE:-@use_response_file_by_default@}" >= 1 )); then - responseFile=$(mktemp "${TMPDIR:-/tmp}/ld-params.XXXXXX") - trap 'rm -f -- "$responseFile"' EXIT + responseFile=$(@mktemp@ "${TMPDIR:-/tmp}/ld-params.XXXXXX") + trap '@rm@ -f -- "$responseFile"' EXIT printf "%q\n" \ ${extraBefore+"${extraBefore[@]}"} \ ${params+"${params[@]}"} \ diff --git a/pkgs/test/cc-wrapper/default.nix b/pkgs/test/cc-wrapper/default.nix index 61d65784f5b9..22991e0dc07d 100644 --- a/pkgs/test/cc-wrapper/default.nix +++ b/pkgs/test/cc-wrapper/default.nix @@ -131,8 +131,8 @@ in stdenv.mkDerivation { ASAN_OPTIONS=use_sigaltstack=0 ${emulator} ./sanitizers ''} - echo "Check whether CC with NIX_CC_USE_RESPONSE_FILE hardcodes all required binaries..." >&2 - NIX_CC_USE_RESPONSE_FILE=1 ${CC} -v + echo "Check whether CC and LD with NIX_X_USE_RESPONSE_FILE hardcodes all required binaries..." >&2 + NIX_CC_USE_RESPONSE_FILE=1 NIX_LD_USE_RESPONSE_FILE=1 ${CC} -v touch $out '';