Commit Graph

631 Commits

Author SHA1 Message Date
Aliaksandr
9921d05da3 treewide: replace stdenv.is* with stdenv.hostPlatform.is*
Assisted-by: claude-code with claude-opus-4-8
2026-08-12 20:27:00 +02:00
K900
935c23a7e9 libclc: drop
Nothing but Mesa uses it, and Mesa uses mesa-libclc now,
so simplify the LLVM builds by deleting this.
2026-08-06 17:26:46 +03:00
Vladimír Čunát
75568a3200 llvmPackages_22.compiler-rt: improve conditional precision
In case of 22 the upstream commit is
9b722024f1
(which reaches tags 22.1.5+, by github.com UI)

Practical issue solved by this is most pkgsRocm based on 22.0.0:
https://hydra.nixos.org/build/339955996/nixlog/3/tail
2026-07-31 13:22:46 +02:00
Randy Eckenrode
d5b6cbf90b llvmPackages_{18,19,20,21}.compiler-rt: backport santizier fix for Linux
Linux dropped `linux/scc.h` from Linux 7.1, which breaks building
compiler-rt when sanitizers enabled. Upstream fixed this for LLVM 23.
This PR cherry-picks the fix for the other LLVM packages in Nixpkgs.
2026-07-26 23:53:10 -04:00
whispers
28e4505698 llvm: add comment about backport selectiondag miscompile fix 2026-07-15 10:32:24 -04:00
whispers
4f7c60edb1 llvm_22: pick patch for selectiondag freeze condition miscompile
see f8a025c964.
this commit backports that same change to LLVM 22. the fix is not
available upstream since LLVM 22 is EOL, but we can pick the patch
from the Rust fork of LLVM, as that is currently on version 22.1.
2026-07-15 10:32:24 -04:00
whispers
f8a025c964 llvm_21: backport patch for selectiondag freeze condition miscompile
Several LLVM versions have a bug in SelectionDAG that causes
miscompilations around conditional poisions. This was exposed due to
Rust 1.97.0 exercising the involved code path heavily and generating
segfaulting code, but the bug existed beforehand as well. The patch was
made to LLVM 23, but the tests have many conflicts, so this is a manual
backport. This backport was made by:

- applying the code change to `llvm/lib`
- hand-updating `test/CodeGen/Mips/cmov.ll` with the same diff as the PR
- updating the rest with `utils/update_llc_test_checks.py` from the LLVM
  source tree, and verifying the diff against the one in the PR.

The last step made this a rather large and gnarly patch, but it's mostly
mechanical.

Rust issue: https://github.com/rust-lang/rust/issues/159035
LLVM issue: https://github.com/llvm/llvm-project/issues/208611
LLVM PR: https://github.com/llvm/llvm-project/pull/208683
2026-07-15 07:16:19 -04:00
Grimmauld
1d05796574 treewide: openmpCheckPhaseHook -> checkPhaseThreadLimitHook 2026-07-10 00:47:02 +02:00
Grimmauld
559ae88af9 llvmPackages.openmp: propagate openmpCheckPhaseHook 2026-06-26 18:42:06 +02:00
Alyssa Ross
606fc62a8e llvmPackages_22.libclc: fix eval + build (#535109) 2026-06-25 10:15:09 +00:00
Ryan Burns
4da4d4bc7b llvmPackages_22.libclc: prepare_builtins was removed in LLVM 22.1
Or more specifically, in:
f07988ff3e
2026-06-24 18:43:30 -07:00
nixpkgs-ci[bot]
16753a2419 Merge staging-next into staging 2026-06-10 07:31:29 +00:00
SandaruKasa
1e688f1324 llvmPackages.bintools-unwrapped: inherit meta.teams from llvm 2026-06-09 01:06:18 +03:00
nixpkgs-ci[bot]
ad3c932e68 Merge staging-next into staging 2026-06-08 00:49:28 +00:00
Tristan Ross
b3578a5bfd llvmPackages_git: 23.0.0-unstable-2026-05-24 -> 23.0.0-unstable-2026-… (#526627) 2026-06-07 23:28:40 +00:00
nixpkgs-ci[bot]
6d151c9ef3 Merge staging-next into staging 2026-06-07 18:29:16 +00:00
Robert Hensing
235013cf37 treewide: drop unnecessary toString calls
Scope:
- Combination of
  - Textual matches of "baseNameOf (toString"
  - Redundant toString calls I've found with my latest
    "lazy paths" nix branch as they force lazy fetches into
    the store. More info and new PR soon.
- Only cases I believe are worthwhile or easily determined

I've determined the validity by
- testing llvmPackages instantiation
- figuring out which types can pass into any particular
  toString call - "human fuzzy type checker"

Behavior considerations by type:

- `path`: converted back to a string *without* context
  `baseNameOf` does not copy things to the store on its own,
  equivalent to its behavior for string inputs
- `null`: converted to `""` -> may be valid input!
  ok if "" would not have been acceptable anyway
- `string` itself: passed through identically -> trivial
- `attrset` with `outPath`: same coercion as built into
  the `baseNameOf` function -> trivial
- other atomic types: generally not sensible inputs to
  `baseNameOf` -> fuzzy but true
2026-06-04 13:11:56 +02:00
nixpkgs-ci[bot]
a0ee92dfa2 Merge staging-next into staging 2026-06-02 00:49:58 +00:00
Clément
5d26766cbf treewide: add missing meta.homepage with source git repository
Added homepage where missing, where the sources are pulled from:
- https://github.com
- https://git.sr.ht
- https://gitlab.com
- https://invent.kde.org
- https://codeberg.org
- https://gitlab.gnome.org
- https://gitlab.freedesktop.org
- https://git.FreeBSD.org
- https://salsa.debian.org
- https://git.tvdr.de
- https://git.suckless.org
2026-06-01 23:40:52 +02:00
Tristan Ross
0917fee1c3 llvmPackages_git: 23.0.0-unstable-2026-05-24 -> 23.0.0-unstable-2026-05-31 2026-05-31 22:49:57 -07:00
nixpkgs-ci[bot]
f25f9861cd Merge staging-next into staging 2026-05-18 18:38:14 +00:00
Alyssa Ross
d2a5a9c051 flang: update support and add flang-rt (#452306) 2026-05-11 14:28:54 +00:00
Xiangyan Sun
be1817333d llvmPackages_22.libc: fix by using hdrgen unconditionally 2026-05-11 02:37:58 -07:00
Acture
7e8258d3af llvm/mlir: fix MLIRConfig.cmake to support external tablegen overrides
MLIRConfig.cmake unconditionally overwrites MLIR_TABLEGEN_EXE and does
not create an imported target, breaking standalone builds that provide
their own mlir-tblgen binary (e.g. Nix sandboxed builds).

The patch adds guards to respect caller-set MLIR_TABLEGEN_EXE,
MLIR_PDLL_TABLEGEN_EXE, and MLIR_SRC_SHARDER_TABLEGEN_EXE values, and
auto-creates an imported mlir-tblgen target for downstream consumers.
This replaces the previous dummy-target workaround in flang's
CMakeLists.txt.

Upstream issue: https://github.com/llvm/llvm-project/issues/150986

Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
2026-05-04 18:06:37 +08:00
Acture
1ba36147a8 flang: package standalone flang with LLVM 20+ driver fixes
Wire flang into llvmPackages as a first-class Fortran compiler. flang
is built standalone on top of the LLVM/clang package set rather than
bundled into the llvm derivation, with passthru metadata
(`langFortran`, `isFlang`, `isClang`, `hardeningUnsupportedFlags`) so
cc-wrapper and downstream tooling can detect and adapt to it.

Driver compatibility patches backported from upstream are applied
selectively per LLVM version:

  * `use-xflang-in-diagnostics` is applied to LLVM 20 and newer; it
    teaches the driver to suggest `-Xflang` instead of `-Xclang` in
    error messages for options only available to `flang -fc1`.
  * `warn-on-fbuiltin-and-fno-builtin` and
    `accept-and-ignore-some-gfortran-optimization-flags` are applied
    to LLVM 20 and 21 only. LLVM 22 has equivalent behaviour merged
    upstream (`warn_drv_invalid_argument_for_flang` and
    `clang_ignored_gcc_optimization_f_Group` handling in
    clang/lib/Driver/ToolChains/Flang.cpp), so the patches are skipped
    there.

Patches live under pkgs/development/compilers/llvm/21/flang/ and are
shared across versions via patches.nix. They are applied to a private
libclang variant rather than the flang source tree because standalone
flang resolves driver/option definitions through the installed libclang
package.

Two focused passthru tests are added:

  * `compile-smoke` exercises basic compilation and `@response-file`
    handling.
  * `driver-flags` covers wrapper flag isolation
    (`NIX_CFLAGS_COMPILE` must not leak into flang;
    `NIX_FFLAGS_COMPILE` must reach it), the backported driver
    diagnostics, and regression coverage for previously hard-erroring
    flags.

Build on the earlier standalone flang work by @picostove.

Co-authored-by: stove <stove@rivosinc.com>
Co-authored-by: acture <acture@gmail.com>
Co-authored-by: Alyssa Ross <hi@alyssa.is>
2026-05-04 18:06:36 +08:00
Acture
324f837bf1 flang-rt: add runtime package
Add a standalone derivation for LLVM's flang-rt runtime libraries
(libFortranRuntime, libFortranDecimal). flang-rt is a runtimes-style
package: building it requires running a working flang binary at *build*
time, but the produced libraries are linked into derivations targeting
the *host*.

The runtime is therefore wired up using `buildFlang`, sourced from
`buildLlvmPackages.flang-unwrapped` so that the build-platform flang
(spliced via the LLVM package set) compiles the runtime, while the
resulting libraries are still produced for the host platform. This
mirrors the existing `buildLlvmTools.tblgen` / `buildLlvmPackages.tblgen`
pattern used elsewhere in the LLVM package set.

`unwrapped` rather than the wrapped flang is used because flang-rt's
CMake glue invokes the compiler directly and does not need (or want)
Nix's cc-wrapper resource-dir and rpath plumbing during the runtime
build.

flang-rt only consumes LLVM's CMake helpers and the build-time flang;
it does not link against MLIR or libclang, so neither MLIR_DIR nor
CLANG_DIR is passed and the unused empty `dev` output is omitted.

Co-authored-by: stove <stove@rivosinc.com>
Co-authored-by: acture <acture@gmail.com>
2026-05-04 18:06:35 +08:00
Acture
6014579a95 clang, cc-wrapper: make wrapper flang-aware
Build on the initial LLVM Flang wrapper work by exposing the needed clang passthru and teaching cc-wrapper about flang-specific flag handling.

Co-authored-by: stove <stove@rivosinc.com>
Co-authored-by: acture <acture@gmail.com>
Co-authored-by: Emily <hello@emily.moe>
Co-authored-by: Philip Taron <philip.taron@gmail.com>
2026-05-04 18:05:42 +08:00
R. Ryantm
2debdbcd54 llvmPackages.lldbPlugins.llef: 2.2.3 -> 2.2.4 2026-05-01 13:49:20 +00:00
jopejoe1
baf97485d9 llvm: make use of compound licenses 2026-04-19 12:25:57 +02:00
Ben Wolsieffer
bf224aefe9 llvm: fix version >=20 on armv6l
We were removing a test that failed on armv6l. In LLVM 20, this test was
moved to a different directory, causing the build to fail. It is not
clear if the test still needs to be removed after this reorganization,
and I don't have hardware that can do a native armv6l build of LLVM.
2026-04-18 22:08:50 -04:00
nixpkgs-ci[bot]
23ee7d594c Merge master into staging-next 2026-03-14 00:21:49 +00:00
Silvan Mosberger
9ae65c847f teams/security-review: init and add as maintainer (#496902) 2026-03-13 18:41:21 +00:00
nixpkgs-ci[bot]
4f1c61e545 Merge master into staging-next 2026-03-13 18:11:40 +00:00
Alyssa Ross
3491f67382 clang-tools: Respect $CLANGD_FLAGS in wrapper (#498874) 2026-03-13 16:26:10 +00:00
Eike Foede
b9ea8c2256 clang-tools: Respect $CLANGD_FLAGS in wrapper
clangd can take arguments also via environment variable CLANGD_FLAGS.
This has to be respected in the wrapper, which checks whether a
--query-driver was provided.
2026-03-12 11:53:22 +01:00
nixpkgs-ci[bot]
28b363b0ae Merge master into staging-next 2026-03-07 12:08:06 +00:00
Alyssa Ross
f38814b27d llvmPackages.lldbPlugins.llef: 2.2.2 -> 2.2.3 (#494846) 2026-03-07 08:24:20 +00:00
Alyssa Ross
b25485cb71 compiler-rt: enable build of libatomic (#488265) 2026-03-07 07:57:37 +00:00
Alexander Bantyev
2839911e81 various: add security-review team as a maintainer
Adds the @NixOS/security-review team as a maintainer to multiple
packages deemed to be important security-wise.

For the motivation of the package list, see:
https://github.com/NixOS/nixpkgs/issues/494349#issuecomment-4005099033
2026-03-05 15:19:44 +01:00
R. Ryantm
c4500bedb9 llvmPackages.lldbPlugins.llef: 2.2.2 -> 2.2.3 2026-02-27 15:34:17 +00:00
nixpkgs-ci[bot]
fa073e0e32 Merge staging-next into staging 2026-02-25 18:24:25 +00:00
Matthias Ahouansou
034613e2bb lldb_22: fix install
It broke due to the extension package.json being moved to a subdirectory
2026-02-25 13:00:53 +00:00
nixpkgs-ci[bot]
323165562d Merge staging-next into staging 2026-02-22 12:09:00 +00:00
nixpkgs-ci[bot]
085a49826d Merge master into staging-next 2026-02-22 12:08:22 +00:00
Theo Paris
4f7aa89ec9 llvmPackages.libc: fix building for embedded targets
Signed-off-by: Theo Paris <theo@theoparis.com>
Change-Id: I5e842dccd5c2c388477b8405e1eb3f2d6a6a6964
2026-02-21 15:56:32 -08:00
Alyssa Ross
9882525c43 clang-tools: add python tools like clang-format-diff to clang-tools (#444818) 2026-02-21 15:30:22 +00:00
Michael Daniels
cdb47d5b88 Merge branch 'staging-next' into staging 2026-02-17 19:55:41 -05:00
Fabián Heredia Montiel
d80b1bccd5 Merge remote-tracking branch 'origin/master' into staging-next 2026-02-17 12:29:41 -06:00
Alexander Bantyev
22ca96f3a9 various: add meta.identifier.cpeParts to a batch of packages
Co-Authored-By: Silvan Mosberger <silvan.mosberger@tweag.io>
2026-02-16 17:11:52 +01:00
Niklas Korz
98f82554c8 llvmPackages_22.llvm: skip empty environment test on darwin 2026-02-15 19:58:31 +01:00