-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llvmPackages: improve gcc compatibility #330316
Conversation
c82ac64
to
a9d38f5
Compare
@@ -157,6 +158,11 @@ stdenv.mkDerivation (rec { | |||
end | |||
MRI | |||
fi | |||
'' | |||
+ lib.optionalString doFakeLibstdcxx '' | |||
ln -s $out/lib/libc++.so $out/lib/libstdc++.so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this need the libstdc++.so.6 variants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you could get around this perhaps by adding a flag when building clang using -DCLANG_DEFAULT_CXX_STDLIB=libc++
for pkgsLLVM
so clang -lstdc++
will get translated to clang -lc++
. this is the default on darwin but not on linux.
a9d38f5
to
5f0f0c2
Compare
Majority of packages with a version script have broken version scripts, this will likely result in us adding this flag to many packages. To keep things simple, just add it as a default.
5f0f0c2
to
019d091
Compare
This commit breaks firefox and thunderbird error: builder for '/nix/store/slax6bvi346jmqjpbh3ixizjgs4bhir5-thunderbird-unwrapped-115.13.0.drv' failed with exit code 1; |
Thank you! =) |
Can you add me as a reviewer on PRs like this in future? I keep not finding out about them until after they've already been merged, despite being an LLVM maintainer. 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. |
Now I get |
In |
Description of changes
As recommended by @tomberek, add common flags to prevent many issues that LLVM would have but GCC wouldn't have.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.