Merge pull request #314781 from rhelmot/freebsd-minimal3/binutils2

binutils: Add --undefined-version on lld 17+
This commit is contained in:
John Ericson 2024-05-26 11:52:58 -04:00 committed by GitHub
commit 0e883cd54a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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