From 27f20550b495fcd95e02b68b36686cc656baed10 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 23 Apr 2022 08:13:09 +0100 Subject: [PATCH] binutils-unwrapped-all-targets: fix libctf breakage Before the change 'postFixup' was breaking binaries as it deleted `libctf.so`'s dependency without fixing the links (https://hydra.nixos.org/build/173957444): objdump: symbol lookup error: ...-binutils-2.38/lib/libctf.so.0: undefined symbol: htab_eq_string Instead of tying binutils and libbfd together let's stop replacing the libraries and use local copies. They are not mechanically interchangeable. Ideally binutils' upstream build system should allow linking external `libbfd`/`libopcodes`/`libctf` but we are not there yet. --- pkgs/development/tools/misc/binutils/default.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 93b018b0d8b0..da2b4864552e 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -21,7 +21,7 @@ in , enableGold ? execFormatIsELF stdenv.targetPlatform , enableShared ? !stdenv.hostPlatform.isStatic # WARN: Enabling all targets increases output size to a multiple. -, withAllTargets ? false, libbfd, libopcodes +, withAllTargets ? false }: # WARN: configure silently disables ld.gold if it's unsupported, so we need to @@ -183,11 +183,9 @@ stdenv.mkDerivation { # Fails doCheck = false; - postFixup = lib.optionalString (enableShared && withAllTargets) '' - rm "$out"/lib/lib{bfd,opcodes}-${version}.so - ln -s '${lib.getLib libbfd}/lib/libbfd-${version}.so' "$out/lib/" - ln -s '${lib.getLib libopcodes}/lib/libopcodes-${version}.so' "$out/lib/" - ''; + # Remove on next bump. It's a vestige of past conditional. Stays here to avoid + # mass rebuild. + postFixup = ""; # INFO: Otherwise it fails with: # `./sanity.sh: line 36: $out/bin/size: not found`