Commit Graph

2326 Commits

Author SHA1 Message Date
Emily
66d78e097f darwin: change the SDK pattern, update the SDKs, and update source releases (#346043) 2024-10-11 00:58:09 +01:00
Randy Eckenrode
34ce30c35a llvmPackages.libllvm: disable tests when built in the Darwin bootstrap
When using the LLVM bootstrap to build LLVM and its libraries,
overriding just LLVM to disable tests during the first build doesn’t
seem to work. This stage name should remain stable, so check for it and
disable tests when building in it.
2024-10-10 16:23:02 -04:00
Randy Eckenrode
18211adceb llvmPackages.libcxx: use a bootstrap stdenv on Darwin
Using a bootstrap stdenv is needed to avoid infinite recursions that
occur due to inputs propagated by SDK that depend on libc++.
2024-10-10 16:23:02 -04:00
Randy Eckenrode
3e5acdacdd llvmPackages.compiler-rt: fix cross-compilation on Darwin
When compiler-rt targets Darwin, it is built with `-target`, which
causes clang to try to invoke `ld` without a target prefix (e.g., it
will try to exec `ld` instead of `x86_64-apple-darwin-ld` on a
cross-build to x86_64-darwin). Specifying `--ld-path` overrides that
behavior, allowing it to find the appropriate cross-linker.
2024-10-10 16:23:02 -04:00
Randy Eckenrode
e6a4c83d20 llvmPackages.compiler-rt: fix compiler-rt bootstrap on Darwin
The first build of compiler-rt in the LLVM bootstrap is build without
libc++ being available, which causes support for the `-g` flag to be
detected incorrectly on Darwin. Overriding the check by specifying that
it’s usable allows the first build of compiler-rt to succeed.
2024-10-10 16:23:01 -04:00
Randy Eckenrode
2fd9a1abeb llvmPackages.compiler-rt: drop use of xcbuild
compiler-rt supports specifying the SDK path and version, so do that to
avoid needing to include `xcrun` as a native build input, which
simplifies the bootstrap.
2024-10-10 16:23:01 -04:00
Randy Eckenrode
7647c6834a llvmPackages.compiler-rt: avoid propagating the SDK in static builds 2024-10-10 16:23:01 -04:00
Randy Eckenrode
654e19fb83 llvmPackages.compiler-rt: always build sanitizers on Darwin
Also enable TSAN since the SDK has xpc. There’s no reason to disable it.
2024-10-10 16:23:01 -04:00
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
Emily
2cbc1ca97d llvmPackages_19: fix building libclc, add aliases (#336465) 2024-10-10 17:36:20 +01:00
github-actions[bot]
b1bc4ea2b5 Merge master into staging-next 2024-10-09 00:14:24 +00:00
Tristan Ross
ee04df014d llvmPackages_git: 20.0.0-git-2024-09-29 -> 20.0.0-git-2024-10-07 2024-10-07 07:46:03 -07: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
github-actions[bot]
5810844b9c Merge master into staging-next 2024-10-02 00:14:22 +00:00
Tristan Ross
8fb95f8b0d llvmPackages_19: 19.1.0 -> 19.1.1 2024-10-01 06:41:48 -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]
ed37db52bd Merge staging-next into staging 2024-09-20 06:05:57 +00:00
Tristan Ross
b7a0ca2c5b llvmPackages_git: 20.0.0-git-2024-09-09 -> 20.0.0-git-2024-09-16 (#342432) 2024-09-19 19:35:11 -07: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
Tristan Ross
9fdc0cc04c llvmPackages_git: 20.0.0-git-2024-09-09 -> 20.0.0-git-2024-09-16 2024-09-16 18:56:52 -07: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
Tristan Ross
b16a3cff39 llvmPackages_git: 20.0.0-git-2024-09-01 -> 20.0.0-git-2024-09-09 (#340924) 2024-09-13 22:53:07 -07: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
Tristan Ross
632c74153f llvmPackages_git: 20.0.0-git-2024-09-01 -> 20.0.0-git-2024-09-09 2024-09-09 20:30:53 -07: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