From a93e6df76412d5a6e9e87fa1764cf9454beff00b Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Fri, 24 May 2024 06:26:20 -0700 Subject: [PATCH] binutils: Add --undefined-version on lld 17+ --- pkgs/development/tools/misc/binutils/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index c707d0daec89..71b438c80519 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -217,6 +217,14 @@ stdenv.mkDerivation (finalAttrs: { ] ++ (if enableShared then [ "--enable-shared" "--disable-static" ] else [ "--disable-shared" "--enable-static" ]) + ++ (lib.optionals (stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17") [ + # lld17+ passes `--no-undefined-version` by default and makes this a hard + # error; libctf.ver version script references symbols that aren't present. + # + # This is fixed upstream and can be removed with the future release of 2.43. + # For now we allow this with `--undefined-version`: + "LDFLAGS=-Wl,--undefined-version" + ]) ; # Fails