Revert "llvmPackages.clangUseLLVM: add --undefined-version by default"

This reverts commit 019d091938.

My comments from the PR (which I only saw after it was merged):

> I'm not convinced this is a good idea — compiler authors turn things
> into errors for a reason, and as a distribution we have our part to
> play in getting problematic things fixed. It's fine to disable the
> errors for packages where it's not reasonably possible to get them
> fixed, but doing it globally means even packages that would be
> simple to fix properly don't get fixed.

> To expand a bit, the problem with this sort of thing is that it's
> very difficult later to tell when it can be removed. By setting this
> globally instead of setting it for individual packages that need it,
> we're effectively stuck with it forever, because it's impossible to
> tell if removing it is going to break any packages. If we mark
> packages individually, it's very easy to tell in future when those
> markings can be removed.
>
> This isn't a theoretical concern: something similar was done for
> pkgsMusl — some compatibility headers were added globally, instead
> of fixing individual affected packages, and now, even though we've
> discovered that the presence of those headers actually causes
> problems for other packages, it's impossible to know what the
> fallout would be of removing it. Let's not repeat this mistake.

So let's revert now, before it's too late.
This commit is contained in:
Alyssa Ross 2024-09-02 17:35:20 +02:00
parent d108ef0484
commit 1c953b1def

View File

@ -756,12 +756,9 @@ let
&& stdenv.targetPlatform.useLLVM or false
) "-lunwind"
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
nixSupport.cc-ldflags =
lib.optionals (!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD)
(
[ "-L${targetLlvmLibraries.libunwind}/lib" ]
++ lib.optional (lib.versionAtLeast metadata.release_version "17") "--undefined-version"
);
nixSupport.cc-ldflags = lib.optionals (
!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD
) [ "-L${targetLlvmLibraries.libunwind}/lib" ];
}
);