From ef178be597e24cf1d34b7079af5265d754cc31a3 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 25 Nov 2017 14:04:43 -0500 Subject: [PATCH] bintools-wrapper: Support ld.ldd, along with ld.bfd and ld.gold Also make the code more precise in the process --- pkgs/build-support/bintools-wrapper/default.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index a9155c2c6eb..dc157acc6cc 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -155,13 +155,11 @@ stdenv.mkDerivation { unset ldInner '') + '' - if [ -e ${bintools_bin}/bin/${targetPrefix}ld.gold ]; then - wrap ${targetPrefix}ld.gold ${./ld-wrapper.sh} ${bintools_bin}/bin/${targetPrefix}ld.gold - fi - - if [ -e ${bintools_bin}/bin/ld.bfd ]; then - wrap ${targetPrefix}ld.bfd ${./ld-wrapper.sh} ${bintools_bin}/bin/${targetPrefix}ld.bfd - fi + for variant in ld.gold ld.bfd ld.lld; do + local underlying=$ldPath/${targetPrefix}$variant + [[ -e "$underlying" ]] || continue + wrap ${targetPrefix}$variant ${./ld-wrapper.sh} $underlying + done set +u '';