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
Make cross stdenv with llvmPackages_7 and useLLVM work again #119717
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sternenseemann
force-pushed
the
libunwind-7.1.0
branch
from
April 17, 2021 16:05
7356b69
to
ab7b072
Compare
sternenseemann
force-pushed
the
libunwind-7.1.0
branch
from
April 17, 2021 16:07
ab7b072
to
cbe8e55
Compare
This reverts commit 76b54c7 and brings llvmPackages_7.libcxxabi in line with what the other llvmPackages sets are doing again (with llvmPackages_7 being the sole outlier). This also fixes an evaluation error of llvmPackages_7.libcxxabi if stdenv.hostPlatform.useLLVM is true as the nonexistant libunwind argument would be overridden.
This reflects what the other llvmPackages sets are doing.
This flag was introduced for clang 9, but we use it in the `lldClang` wrapper for `llvmPackages` 7, 8 and 9. For this purpose the patch was backported for `llvmPackages_8.clang`, but not for `llvmPackages_7.clang` which has been done in this commit. `lldClang` is mostly used when cross compiling and `stdenv.hostPlatform.useLLVM` is true. Most likely this problem wasn't noticed since `useLLVM` with `llvmPackages_7` was broken for other reasons as well and all cross targets (like `wasi32`) which have `useLLVM` at the moment use `llvmPackages_8`. With this change tests.cross.llvm.hello.{musl64, …} works again.
sternenseemann
force-pushed
the
libunwind-7.1.0
branch
from
April 17, 2021 16:08
cbe8e55
to
49ff650
Compare
@ofborg build llvmPackages_7.libcxxabi |
libcxxabi on aarch64 failure is not new: https://hydra.nixos.org/job/nixpkgs/trunk/llvmPackages_7.libcxxabi.aarch64-linux |
Darwin bootstrap broke, sorry -- I misunderstood what had been tested. But I am fixing this. |
10 tasks
10 tasks
sternenseemann
added a commit
to sternenseemann/nixpkgs
that referenced
this pull request
May 10, 2021
Provide a version of nixpkgs which is built using the LLVM toolchain. This is achieved by reusing the useLLVM attribute usable in the cross toolchain bootstrapping which is a) perfectly acceptable and b) the only way to bootstrap a LLVM stdenv across platforms without unreasonable amounts of work. This is mostly working now since we fixed some issues with llvmPackages_7.lldClang in NixOS#119717 and compile glibc with gcc at all times as of NixOS#119786 (since clang can't compile our glibc at the moment). There are seemingly some issues left to be ironed out, for example the C++ library of ncurses fails to build with a linking issue. I have attempted to alleviate that problem with NixOS#120790, but to no avail so far. Nonetheless, having a working pkgsLLVM.hello is a good start. A currently present issue is that there is no way to change the libc since there is some issue with lldClang actually picking up on the set libc. This will need investigation and fixing.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
This makes cross compilation work again when
stdenv.hostPlatform.useLLVM
is true andllvmPackages
points tollvmPackages_7
. There were the following problems:libcxxabi
wouldn't evaluate foruseLLVM == true
since in that caselibunwind
would be passed as an argument. This PR makeslibunwind
an optional dependency oflibcxxabi
again and packageslibunwind
of llvm 7 as well.lldClang
passed--unwindlib
toclang
, but this option was introduced for clang 9. This PR backports this change for clang 7 similarly to how it was done for clang 8.tests.cross.llvm.hello.musl64
now works again!Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)