Commit graph

747 commits

Author SHA1 Message Date
sternenseemann 4caedc060f llvmPackages_12.libunwind: Make sure we get right llvm version 2021-05-12 00:12:51 +00:00
sternenseemann 894a09dfd2 llvmPackages_7.lldClang: add libunwind to extraLibraries 2021-05-12 00:12:40 +00:00
sternenseemann 53adcfb798 llvmPackages_7.libunwind: simplify expressions
* Use LLVM_PATH instead of llvm-config
* Pass less unnecessary options to cmake
2021-05-12 00:08:02 +00:00
John Ericson cf02b24813 Merge remote-tracking branch 'upstream/staging-next' into staging 2021-05-11 22:30:46 +00:00
s1341 1e1d29c2af treewide: Support aarch64-android using minimal prebuilt components
This PR adds a new aarch64 android toolchain, which leverages the
existing crossSystem infrastructure and LLVM builders to generate a
working toolchain with minimal prebuilt components.

The only thing that is prebuilt is the bionic libc. This is because it
is practically impossible to compile bionic outside of an AOSP tree. I
tried and failed, braver souls may prevail. For now I just grab the
relevant binaries from https://android.googlesource.com/.

I also grab the msm kernel sources from there to generate headers. I've
included a minor patch to the existing kernel-headers derivation in
order to expose an internal function.

Everything else, from binutils up, is using stock code. Many thanks to
@Ericson2314 for his help on this, and for building such a powerful
system in the first place!

One motivation for this is to be able to build a toolchain which will
work on an aarch64 linux machine. To my knowledge, there is no existing
toolchain for an aarch64-linux builder and an aarch64-android target.
2021-05-11 15:39:08 +00:00
Vladimír Čunát 6b3b7940ff
llvm*Packages: fix output selection (lib.get*) 2021-05-11 10:45:11 +02:00
John Ericson 8629936f82 compiler-rt: Revert passing COMPILER_RT_OS_DIR and not symlinking libs
In 7869d16545 I got rid of the symlinking
by forcing `COMPILER_RT_OS_DIR` to always be the empty string. I thought
this was good because it just make compiler-rt be installed in a normal
way.

However, various LLVM tools expect the `COMPILER_RT_OS_DIR` to be set
normally, and fail to find things when they aren't in the expected lib
subdir.

Maybe it would be best to patch that too in the long term, but for now
we just undo this change.
2021-05-09 22:52:09 +00:00
John Ericson fc7a998748 compiler-rt: Fix build by passing resource dir
Before, clang was able to find some headers with a relative path to the
`-B` flag pointing near the unwrapped clang binary. But with multiple
outputs that doesn't work, so we use a "resource directory" as it done
later in the bootstrap.
2021-05-07 16:39:19 +00:00
Andrew Childs 7869d16545 llvmPackages: Multuple outputs for everythting
Also begin to start work on cross compilation, though that will have to
be finished later.

The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.

Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.

----

Other misc notes, highly incomplete

- lvm-config-native and llvm-config are put in `dev` because they are
  tools just for build time.

- Clang no longer has an lld dep. That was introduced in
  db29857eb3, but if clang needs help
  finding lld when it is used we should just pass it flags / put in the
  resource dir. Providing it at build time increases critical path
  length for no good reason.

----

A note on `nativeCC`:

`stdenv` takes tools from the previous stage, so:

1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`

while:

1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
2021-04-30 05:41:00 +00:00
Jan Tojnar c1f851b2ee
Merge branch 'staging-next' into staging 2021-04-25 08:22:13 +02:00
Michael Weiss e4f8498c0b
llvmPackages_12: Create subdirectories for the last two packages
For consistency. Now all packages will have their own subdirectory
(continuation of 781e69d19c).
2021-04-24 11:43:29 +02:00
Michael Weiss a902d99422
llvmPackages_12: Always use the attribute name for pname
This might be a bit debatable but upstream uses "xx" instead of "++"
when using it as identifier / in the code (file/directory names, build
scripts, website URLs, etc.) so we should probably too.
And at least the attribute name and pname will be consistent now.
2021-04-24 11:43:29 +02:00
John Ericson 3af7e98470 llvmPackages_7.libcxxabi: Fix Darwin bootstrap
In 486e12ad68 cmake flags were added matching
later compilers use of libunwind for `useLLVM = true`. Unfortunately, `useLLVM`
on Darwin was not something tested before, and so the other compilers led us
astray: one of the new flags tried to make libunwind be used when it wasn't a
dep.

This is now fixed with more conditional code, but I hope things can perhaps be
made simpler with more insight into why libunwind is skipped. Perhaps it is
included in libSystem?

Finally, I moved the definition of `cmakeFlags` to match the order in the other
llvm versions.

CC @sternenseemann and @thefloweringash
2021-04-18 00:24:03 -04:00
John Ericson d4d49c1066
Merge pull request #119717 from sternenseemann/libunwind-7.1.0
Make cross stdenv with llvmPackages_7 and useLLVM work again
2021-04-17 19:59:19 -04:00
sternenseemann 49ff6509a2 llvmPackages_7.clang: backport patch introducing --unwindlib flag
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.
2021-04-17 18:08:04 +02:00
sternenseemann 55a476b00b llvmPackages_7.libcxx: make sure to use compiler-rt if useLLVM
This reflects what the other llvmPackages sets are doing.
2021-04-17 18:08:04 +02:00
sternenseemann 486e12ad68 llvmPackages_7.libcxxabi: take libunwind as an optional dependency again
This reverts commit 76b54c75b3 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.
2021-04-17 18:08:00 +02:00
sternenseemann be4eb91b3c llvmPackages_7.libunwind: init at 7.1.0 2021-04-17 18:07:12 +02:00
Luke Granger-Brown 9aa8ae999a llvmPackages_12.llvm: fix building on older CPUs
This commit patches one of the llvm-exegesis tests to swap out whatever
CPU model happens to be on the build host for bdver2 (AMD Family
15h/Piledriver), which was picked because it looks like that was the
intent of the test author. This provides a more predictable compilation
behaviour when running on older (or possibly even newer!) machines.

One of the machines that is currently part of the NixOS Hydra build
farm, wendy, is using an old AMD Opteron CPU for which LLVM has no
scheduling machine model. This causes one of the tests for llvm-exegesis
to fail, because it segfaults trying to use the machine model to produce
useful analysis results.

Note that this particular test only runs on x86-64 build hosts anyway;
aarch64 isn't affected.

This deliberately only patches LLVM 12 to limit the rebuilds; other
LLVM versions are going through staging.
2021-04-17 01:55:53 +00:00
Michael Weiss 28887e7fe5
llvmPackages_12: Improve and extend the meta attributes 2021-04-15 18:41:38 +02:00
Michael Weiss 2c2e8662b9
llvmPackages_12: 12.0.0-rc5 -> 12.0.0
Release notes: https://releases.llvm.org/12.0.0/docs/ReleaseNotes.html
2021-04-15 16:31:32 +02:00
Michael Weiss 978fa19ae2
Merge pull request #119528 from sternenseemann/llvmPackages_12-reorganize-files
llvmPackages_12: reorganize files
2021-04-15 16:25:17 +02:00
sternenseemann 081b9423d4 llvmPackages*: fix paths to libcxx-0001-musl-hacks.patch
This patches are included from libcxx and libcxxabi when
stdenv.hostPlatform.isMusl. After #117433 the patchs to that patch
wasn't adjusted for the new structure, likely because it doesn't come up
during normal eval. This fixes (among other attribute paths):

* pkgsMusl.llvmPackages_12.libcxxabi
* pkgsMusl.llvmPackages_12.libcxx
* pkgsMusl.llvmPackages_11.libcxxabi
* pkgsMusl.llvmPackages_11.libcxx
* pkgsMusl.llvmPackages_10.libcxxabi
* pkgsMusl.llvmPackages_10.libcxx
* pkgsMusl.llvmPackages_9.libcxxabi
* pkgsMusl.llvmPackages_9.libcxx
* pkgsMusl.llvmPackages_8.libcxxabi
* pkgsMusl.llvmPackages_8.libcxx
* pkgsMusl.llvmPackages_7.libcxxabi
* pkgsMusl.llvmPackages_7.libcxx
* pkgsMusl.llvmPackages_6.libcxxabi
* pkgsMusl.llvmPackages_6.libcxx
* pkgsMusl.llvmPackages_5.libcxxabi
* pkgsMusl.llvmPackages_5.libcxx

Only evaluation was tested, not compilation though.
2021-04-15 13:24:04 +02:00
sternenseemann 781e69d19c llvmPackages_12: reorganize files
Restructure pkgs/development/compilers/llvm/12 in a similar spirit
as #117433 to mirror the other llvm directories.
2021-04-15 12:44:05 +02:00
Tyson Whitehead 9f7fb75168
llvm_11: Correct path for TLI-musl patch 2021-04-14 00:29:29 -04:00
github-actions[bot] 85b57e4446
Merge master into staging-next 2021-04-08 18:14:17 +00:00
Michael Weiss 2b95bf44b8
llvmPackages_12: 12.0.0-rc4 -> 12.0.0-rc5
Note: Tested in #116646.
2021-04-08 16:12:48 +02:00
github-actions[bot] b3a0328b7f
Merge master into staging-next 2021-04-02 18:14:54 +00:00
Michael Weiss a960fead6e
llvmPackages_12: 12.0.0-rc3 -> 12.0.0-rc4 2021-04-02 14:35:23 +02:00
github-actions[bot] 78b864aeee
Merge staging-next into staging 2021-04-01 18:15:42 +00:00
Michael Weiss cc12a82cf2
llvmPackages_12: Fix libunwind, openmp, libcxx, and libcxxabi
All builds succeed now: nix-build -A llvmPackages_12
2021-04-01 20:08:20 +02:00
github-actions[bot] 85e9b4acf4
Merge staging-next into staging 2021-04-01 12:06:32 +00:00
Michael Weiss 493131d70b
llvmPackages: Add an update script
This is based on a combination of Gabor Greif's update script [0] and my
script to verify the hashes [1]. It's a bit hacky / unconventional but
it should be very useful and worked fine so far (but it might require
changes for some edge-cases).

[0]: https://github.com/NixOS/nixpkgs/issues/100725#issuecomment-710055349
[1]: https://github.com/NixOS/nixpkgs/issues/100725#issuecomment-781323979
2021-04-01 13:31:48 +02:00
Gabor Greif 7c27d49815
llvmPackages_12: init at 12.0.0-rc3
https://lists.llvm.org/pipermail/release-testers/2021-March/001496.html
2021-04-01 12:32:19 +02:00
Michael Weiss 2fd9e41719
llvmPackages_12: Copy from llvmPackages_11 2021-04-01 12:32:18 +02:00
github-actions[bot] 2ed7687b19
Merge staging-next into staging 2021-03-28 00:15:43 +00:00
sternenseemann a3f74559cf llvmPackages_6.llvm-manpages: unbreak
enableSharedLibraries defaulted to true which caused a phase to
try to use the $lib output which doesn't exist for the llvm-manpages
derivation.
2021-03-27 22:40:44 +01:00
John Ericson 8179fdc3d1
Merge pull request #117660 from Ericson2314/organize-llvm
llvmPackages_*.libunwind: Move into own directory
2021-03-26 10:25:23 -04:00
Jan Tojnar b3c854b60b
Merge branch 'staging-next' into staging 2021-03-26 07:53:44 +01:00
John Ericson 0ae1182489 llvmPackages_*.libunwind: Move into own directory
I expect to soon give it some patches that would go in there too, but
either way it's good to match the others.
2021-03-26 05:06:15 +00:00
Daniël de Kok 84023d85cb llvmPackages_rocm: 4.0.1 -> 4.1.0 2021-03-24 08:43:58 +01:00
John Ericson 19a974945b llvmPackages: Organize files
Always do pkg/default.nix not pkg.nix; use directories to avoid
prefixing patches and other files.
2021-03-24 05:02:50 +00:00
Andrew Childs 2a588dad4e llvmPackages_{10,11}.compiler-rt: restrict build to current arch
Workaround for build failure after adding mandatory -arch
argument. Nixpkgs targets a single architecture, so this saves a small
amount of wasted build effort.

See https://github.com/NixOS/nixpkgs/pull/114817#issuecomment-802709527
2021-03-19 20:23:24 +00:00
Andrew Childs 8cc0010f0c llvmPackages_*.compiler-rt: use darwinArch 2021-03-19 20:23:23 +00:00
Robert Hensing 89aa0173ca
Merge pull request #115075 from siraben/stdenv-cleanup
treewide: remove stdenv where not needed
2021-03-04 15:51:04 +01:00
Ben Siraphob 98f26993f2 treewide: remove stdenv where not needed 2021-03-04 19:54:50 +07:00
Sandro dc00d91809
Merge pull request #111701 from r-burns/compiler-rt
llvmPackages_11.compiler-rt: fix build on darwin
2021-03-04 03:50:29 +01:00
Ivan Babrou d85965dcf5 llvmPackages_11.libcxx: backport block.h fix from llvm12
As a concrete example, this fixes graphviz compilation:

* https://gitlab.com/graphviz/graphviz/-/issues/1785
2021-02-28 10:19:14 -08:00
Ivan Babrou f78f6cd339 llvmPackages_11.openmp: make it compile on aarch64-darwin 2021-02-26 09:24:00 -08:00
Gabor Greif 3468130c1e llvmPackages_11: 11.1.0rc2 -> 11.1.0 2021-02-18 13:11:24 +01:00