Commit Graph

631 Commits

Author SHA1 Message Date
Randy Eckenrode
d3114e05d7 llvmPackages.compiler-rt: align Darwin bootstrap with other platforms
Instead of using overrides in the stdenv bootstrap, Darwin will be
relying on the LLVM bootstrap to build compiler-rt. The only special
handling it needs is to use a stdenv with a bootstrap SDK instead of the
default one (to avoid infinite recursions).
2024-10-10 16:23:01 -04:00
Randy Eckenrode
4dc3227d4c llvmPackages.clang: use the system libunwind on Darwin
While the Darwin stdenv bootstrap sets up its own clang wrappers and
doesn’t provide these wrappers in the final stdenv, it does use them
indirectly via the LLVM bootstrap to build LLVM and its libraries.

Note on using the system libunwind: It is possible to build and use the
LLVM libunwind on Darwin, but using the system by default one ensures
everything is using the same unwinder.
2024-10-10 16:23:01 -04:00
Randy Eckenrode
25c6fe1dc3 llvmPackages.clang: backport __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
Newer SDKs use this on Darwin. Without it, using the 14.4 and 15.0 SDKs
won’t work with clang 16.
2024-10-10 16:23:01 -04:00
github-actions[bot]
c64ae284c0 Merge master into staging-next 2024-10-10 18:04:46 +00:00
Tristan Ross
6bb12aca3d llvmPackages_19.libclc: fix formatting 2024-10-06 09:24:59 -07:00
Tristan Ross
a80f2c1e2d llvmPackages_19.libclc: fix building 2024-10-06 09:24:58 -07:00
K900
3f7da3dfa9 Merge remote-tracking branch 'origin/master' into staging-next 2024-10-01 08:44:24 +03:00
Tristan Ross
5792062b63 llvmPackages_git: 20.0.0-git-2024-09-22 -> 20.0.0-git-2024-09-29 2024-09-29 21:19:05 -07:00
Alyssa Ross
ac037f0b18 Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
	pkgs/development/compilers/llvm/common/default.nix
2024-09-29 20:10:12 +02:00
Tristan Ross
a95f58cca4 llvmPackages_19: 19.1.0-rc3 -> 19.1.0 2024-09-29 17:03:11 +02:00
Tristan Ross
5b68f9c5f4 llvmPackages_git: 20.0.0-git-2024-09-16 -> 20.0.0-git-2024-09-22 (#343867) 2024-09-29 07:07:38 -07:00
Tristan Ross
d55298086a llvmPackages_git: 20.0.0-git-2024-09-16 -> 20.0.0-git-2024-09-22 2024-09-25 06:59:58 -07:00
Artturin
f0e657f3b1 Merge branch 'master' into staging-next 2024-09-25 06:05:01 +03:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
Alyssa Ross
1c953b1def 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.
2024-09-23 21:08:38 +02:00
Fabián Heredia Montiel
9b2a506736 Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:

- pkgs/tools/package-management/nix/default.nix
2024-09-22 13:45:27 -06:00
Tristan Ross
464d8f5eff llvmPackages.*: Add devExtraCmakeFlags parameter (#342040) 2024-09-22 11:29:19 -07:00
Tristan Ross
25e07e7c53 llvmPackages: Reinstate overriding across whole package set (#341855) 2024-09-22 11:03:58 -07:00
K900
5a9d1835e1 glibc: 2.39-52 -> 2.40-36 (#342073) 2024-09-20 19:42:37 +03:00
github-actions[bot]
44c701d84e Merge staging-next into staging 2024-09-19 06:05:13 +00:00
Jörg Thalheim
fff5e5e385 llvmPackages.compiler-rt: Use FreeBSD headers during noLibc build (#335703) 2024-09-19 08:01:06 +02:00
Guillaume Girol
07c899657a compiler-rt: apply armv6l patches to llvm >= 15 where applicable (#333922) 2024-09-15 19:39:15 +02:00
Maximilian Bosch
92f4286cd8 llvm{17,18}: fix build w/ glibc-2.40
See https://github.com/llvm/llvm-project/pull/100804 for further
context.

Tests for LLVM 12 to 16 pass fine without this change (the entire
section of the test doesn't exist there), our LLVM 19 already has the
patch applied.
2024-09-15 16:28:39 +02:00
Peter Waller
290ec4e775 llvmPackages.*: Add devExtraCmakeFlags parameter
cmake flags have a 'last flag wins' logic, so by appending to the end of
the flags it is possible to override any cmake flag.

It also ignores (and warns) if a flag is unused, so passing flags across
all packages should be safe if you want to target one package.

In combination with #320261, this PR allows consistently overriding all
packages within LLVM with additional cmake arguments. Consistency here
means for example 'if you override LLVM, then all dependencies on it are
also see the overridden LLVM in their input'. Consistency is hard to
achieve with the other obvious way of implementing this as a user: if
you use overrideAttrs then you have to write a big mess of override code
in order to override all dependents, and this can be very difficult in a
cross-compilation scenario using crossSystem and useLLVM, for example.

With this PR it is possible to write an overlay which overlays
`llvmPackages` with `llvmPackage.override { devExtraCmakeFlags = [ ... ]; }`,
and then the toolchain used with useLLVM in effect should respect
these flags.

This is useful in development for experimenting with the effect of
various flags, hence the chosen name `devCmakeFlags`.

This won't work out of the box without #341855 applied, which fixes
override passthrough.

See-Also: #320261, #341855
Signed-off-by: Peter Waller <p@pwaller.net>
2024-09-15 11:50:52 +01:00
Peter Waller
ddafd4b14a llvmPackages: Reinstate overriding across whole package set
Pull #320261 introduced the possibility to consistently override
dependencies within an llvm package set. I think #325175 accidentally
dropped this, so reinstate it.

Signed-off-by: Peter Waller <p@pwaller.net>
2024-09-15 10:09:34 +01:00
Guillaume Girol
7b6139f472 compiler-rt: apply armv6l patches to llvm >= 15 where applicable
the patches were written for
https://github.com/NixOS/nixpkgs/pull/205176 but not kept for llvm >= 15
2024-09-14 12:00:00 +00:00
Emily
1e9f032878 llvmPackages_{14,15,16,17}.lldb: use SWIG 4
The patches are already included in LLVM 16 and 17.
2024-09-12 15:41:30 +01:00
Emily
0fe59d8900 llvmPackages_{12,13}.lldb: mark broken
These have been failing to build on Hydra for over two months. It
looks like it might be a Python 3.12‐related thing, but the SWIG
4 patches wouldn’t apply cleanly and these old versions should
probably just be dropped anyway.
2024-09-12 14:25:25 +01:00
Weijia Wang
166126d1e7 llvmPackages_14.lldbPlugins.llef: 1.1.0 -> 1.2.0 (#335122) 2024-09-10 21:43:22 +02:00
Artturin
d1f2bc2931 llvmPackages_git.compiler-rt: disable building ctx_profile when build sanitizers are disabled (#332918) 2024-09-07 17:42:49 +03:00
Tristan Ross
453e5b9c6c llvmPackages_git: 20.0.0-git-2024-08-25 -> 20.0.0-git-2024-09-01 (#338931) 2024-09-02 22:37:06 -07:00
Alyssa Ross
5ebc220565 llvm: add loongarch64 to supported architectures 2024-09-02 08:48:51 +02:00
Tristan Ross
0c3b35b3a1 llvmPackages_git: 20.0.0-git-2024-08-25 -> 20.0.0-git-2024-09-01 2024-09-01 20:53:45 -07:00
Tristan Ross
7e623c1abd llvmPackages_19.lldb-manpages: copy llvm docs for python llvm_slug module 2024-08-21 19:50:20 -07:00
Tristan Ross
26d737c348 llvmPackages_19.openmp: fix patches 2024-08-21 19:50:16 -07:00
Audrey Dutcher
d45b39bb89 llvmPackages.compiler-rt: Use FreeBSD headers during noLibc build 2024-08-19 21:02:56 -07:00
Philip Taron
99aabc6f9e llvm: remove with statements from common.nix 2024-08-18 06:31:15 -07:00
R. Ryantm
9717a2f8fa llvmPackages_14.lldbPlugins.llef: 1.1.0 -> 1.2.0 2024-08-16 13:32:21 +00:00
tomberek
94574c75c3 Merge pull request #333521 from ExpidusOS/feat/llvm-patch-common
llvmPackages_{12,13,14,15,16,17,18,19,git}: commonify patches
2024-08-16 02:47:43 -04:00
Tristan Ross
77f6edfd59 llvmPackages: refactor patch matching 2024-08-15 23:03:34 -07:00
tomberek
7248a7fde6 Merge pull request #333146 from ExpidusOS/feat/llvm-clean
Minor LLVM improvements
2024-08-16 01:34:50 -04:00
github-actions[bot]
68894e5504 Merge master into staging-next 2024-08-10 00:02:11 +00:00
Tristan Ross
91b815278f Merge pull request #303800 from nrabulinski/llef-update
llef: unstable-2023-10-18 -> 1.1.0
2024-08-09 15:52:49 -07:00
Tristan Ross
4fb416db89 llvmPackages_{19,git}.libcxx: commonify patches 2024-08-09 14:40:12 -07:00
Tristan Ross
76f48d38f8 llvmPackages_{15,17,18,19,git}.openmp: commonify patches 2024-08-09 14:13:36 -07:00
Tristan Ross
7b4be56d9c llvmPackages_{13,15,16,17,18,19,git}.llvm: commonify patches 2024-08-09 14:11:56 -07:00
Tristan Ross
f95daad5d4 llvmPackages_{13,14,15,16,17,18,19,git}.lldb: commonify patches 2024-08-09 14:09:39 -07:00
Tristan Ross
7b52fe74c7 llvmPackages_{13,17,19,git}.lld: commonify patches 2024-08-09 14:08:41 -07:00
Tristan Ross
93613836ca llvmPackages_{15,16}.libunwind: commonify patches 2024-08-09 14:07:10 -07:00
Tristan Ross
314cebce73 llvmPackages_{13,14,15,16,17,18,git}.compiler-rt: commonify patches 2024-08-09 14:06:56 -07:00