-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
[staging-next] firefox: use rustc.llvmPackages.stdenv with LLVM bintools, fix deadlock #145459
[staging-next] firefox: use rustc.llvmPackages.stdenv with LLVM bintools, fix deadlock #145459
Conversation
I can appreciate why we need a new argument to I think in this case I'd just suggest to use a different name for the thing at hand. |
I'd prefer Also worth mentioning that the original issue is only about What's you opinion on this? Should we keep |
It makes more sense to drop the gcc stuff, because an This whole annoyance brings me to consider whether we should be exposing I think there may be a way to sidestep the whole issue for now: Do you know why |
It was introduced for LTO support and used to be
I'm not sure if |
Right, my plan was to reintroduce |
Current draft for a quick and simpler workaround: diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix
index c99d1c10a12..e1ad8e030fc 100644
--- a/pkgs/applications/networking/browsers/firefox/common.nix
+++ b/pkgs/applications/networking/browsers/firefox/common.nix
@@ -109,9 +109,11 @@ let
# When LTO for Darwin is fixed, the following will need updating as lld
# doesn't work on it. For now it is fine since ltoSupport implies no Darwin.
+ # TODO(@sternenseemann): reintroduce lldClang and replace hack (see #142901)
buildStdenv = if ltoSupport
- then overrideCC stdenv llvmPackages.clangUseLLVM
- else stdenv;
+ then overrideCC stdenv (llvmPackages.clang.override {
+ inherit (llvmPackages) bintools;
+ }) else stdenv;
# --enable-release adds -ffunction-sections & LTO that require a big amount of
# RAM and the 32-bit memory space cannot handle that linking Just started a build, fingers crossed… |
Currently `clangUseLLVM` is broken since it uses libcxx and compiler-rt but also specifies `--gcc-toolchain`, which leads to weird compile errors when including C++ headers.
21626a1
to
57fa7ae
Compare
It's built successfully. I also included a patch from Arch fixing a deadlock. I just ran into it when playing the previous build. This comment is sent from the built result. |
Motivation for this change
Fix #144670
ZHF: #144627
Follows #144670 (comment)
Update: Currently we switch to
llvmPackages*.stdenv
with LLVMbintools
to build firefox. LLVM and cc-wrapper are not touched.Outdated:
In
clangUseLLVM
we explicit use FULL LLVM toolchain, we should not set--gcc-toolchain
anymore.Well, it seems cannot explain why LLVM 12 works when this option is provided. According Clang 13.0.0 Release Notes, there are some internal changes occurs on
-B
and--gcc-toolchain
. In our case and some experiments, in LLVM 13, when--gcc-toolchain
is specified, its include path will take precedence overlibc++
and mess up everything, no matter whether this option is before-isystem
or after. I guess that we are just not expected to setgcc-toolchain
in full LLVM toolchain usage but it used to work due to some magic.Currently I just remove
--gcc-toolchain
fromllvmPackages_13.clangUseLLVM
, not any older version.I checked that LLVM 12 with that option removed doesn't affect a simple hello-world build, but not sure if downstream packages still build. So I'm just not touching them.
After this PR,
firefox
builds and runs flawless for me.Note that
clangUseLLVM
is currently only used byfirefox
and cross compilation, I think no other package is affected.Things done
nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)