Commit Graph

158 Commits

Author SHA1 Message Date
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
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
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
David McFarland
d613d20a13 treewide: fix nix-env eval in cross 2025-12-04 19:44:19 -04:00
Aliaksandr
03bb7d8195 all-packages: do not export lib functions from pkgs 2025-10-30 22:38:49 +02:00
Emily
2d6ca409d6 llvmPackages: add comments about suspicious things 2025-10-25 20:07:13 +01:00
Emily
3a8c494305 llvmPackages: remove things made unnecessary by splicing 2025-10-25 20:07:13 +01:00
Emily
8b6e86acfb llvmPackages: remove unnecessary use of pkgs 2025-10-25 20:07:13 +01:00
Emily
210060e66c llvmPackages.openmp: don’t use a target platform LLVM
This was used in 4b07aeae16 to get
what was actually a *host* LLVM in practice, when the `buildHost`
LLVM package set was included in the `callPackage` scope used for
libraries. It should no longer be necessary and is now quite confusing.
2025-10-25 20:07:13 +01:00
Tristan Ross
62d59194b8 pkgs/development/compilers/llvm: use makeScopeWithSplicing'
Co-authored-by: Luna Nova <git@lunnova.dev>
Co-authored-by: Emily <vcs@emily.moe>
2025-10-25 20:06:32 +01:00
nixpkgs-ci[bot]
e23d356469 Merge staging-next into staging 2025-10-05 00:18:23 +00:00
K900
f8d669f413 Merge remote-tracking branch 'origin/master' into staging-next 2025-10-04 21:10:21 +03:00
NAHO
c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00
Alyssa Ross
4d44f8fa53 llvmPackages.compiler-rt: clean up libxcrypt fix
This is unnecessary since LLVM commit d7bead833631 ("[sanitizer]
Remove crypt and crypt_r interceptors"), included in LLVM 18, the
oldest version we still have in Nixpkgs.
2025-09-30 22:40:41 +02:00
Luna
957d7fea18 llvmPackages: clean up rebuild avoidance 2025-09-30 08:25:32 -07:00
Emily
d51c4559ea llvmPackages.libclc: expose regardless of version (#443315) 2025-09-16 04:52:54 +01:00
Emily
6ac21d552a llvmPackages.libclc: expose regardless of version
It doesn’t make sense to drop the attribute just because we
don’t yet have a `spirv-llvm-translator` that can work with it
yet, especially as they’ve been adding support for the native LLVM
SPIR‐V backend. It will now be marked as broken transitively if
`spirv-llvm-translator` is unavailable.
2025-09-16 02:52:43 +01:00
Randy Eckenrode
c4c5d25f13 pkgs/stdenv/darwin: switch to using the system libc++ by default 2025-09-15 19:24:08 +01:00
Randy Eckenrode
5ea679485d llvmPackages.clang: add systemLibcxxClang (primarily for Darwin) 2025-09-15 19:24:08 +01:00
Emily
2dac87bbde llvmPackages_17: drop 2025-09-14 19:03:24 +01:00
Emily
a892ce396d llvmPackages_16: drop 2025-09-14 19:03:24 +01:00
Emily
77acbe1f9c llvmPackages_15: drop 2025-09-14 19:03:24 +01:00
Emily
f470ea24b6 llvmPackages_14: drop 2025-09-14 19:03:24 +01:00
Emily
791fe23b63 llvmPackages_13: drop 2025-09-14 19:03:24 +01:00
Emily
d49413f1f4 llvmPackages: add comment for mistake 2025-09-14 19:03:24 +01:00
Emily
8f33b55254 llvmPackages: remove redundant comment 2025-09-14 19:03:24 +01:00
blenderfreaky
fd261cb094 llvmPackages_{20,21}.libclc: reenable and update patches 2025-08-29 21:45:56 +02:00
acture
8c68eb9711 flang: init at 20.x 2025-08-22 20:16:20 +02:00
Alyssa Ross
cfb6649fa7 llvmPackages: drop libclc attributes that error
libclc requires a compatible version of spirv-llvm-translator.  If we
don't have such a version, we get an eval error.  This means that
OfBorg builds of llvmPackages sets where libclc is unavailable will
produce an eval error, which is very confusing.  To fix this, restrict
the libclc attribute to LLVM versions where it actually exists.

Link: https://github.com/NixOS/nixpkgs/pull/414615#issuecomment-3126935312
2025-07-30 14:27:27 +02:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
K900
7e4f0fbf9d Merge remote-tracking branch 'origin/master' into staging-next 2025-06-06 21:50:43 +03:00
John Ericson
5c1955ff14 libcCross: Remove!
We have a long-standing goal of nothing with "cross" in its name. This
gets us much closer!
2025-06-05 18:11:07 -04:00
John Ericson
ddf7c357d4 clang-wrapper: add special case for FreeBSD headers (#384615) 2025-05-28 19:52:17 -04:00
nixpkgs-ci[bot]
e739bdf527 Merge staging-next into staging 2025-04-03 18:05:52 +00:00
Tristan Ross
1b53ec3a45 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.lldb: move into lldb directory 2025-04-03 18:13:07 +02:00
nixpkgs-ci[bot]
d05ee1c1cb Merge staging-next into staging 2025-04-02 16:38:11 +00:00
Tristan Ross
3d9f74651d llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libclc: move into libclc directory 2025-04-02 14:44:58 +02:00
Tristan Ross
3b56cf6ff8 llvmPackages.clangNoLibcNoRt: drop nostartfiles flag
`-nostartfiles` used to be needed for pkgsLLVM, causes problems so don't
include it.
2025-03-24 06:54:40 -07:00
Tristan Ross
bf31adf9ad llvmPackages_20.libc-full: fix infinite recursion with pkgsLLVMLibc in cmake & python3 2025-03-20 08:04:28 -07:00
Tristan Ross
3cbbfb1795 pkgs/development/compilers/llvm/common/default.nix: move patches into… (#389658)
pkgs/development/compilers/llvm/common/default.nix: move patches into patches.nix
2025-03-16 23:36:53 -04:00
zvolin
1ab394e053 llvmPackages_17.{clang,tblgen}: fix builds on aarch64 2025-03-09 11:53:33 +01:00
Tristan Ross
decbece965 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.llvm: move patches out of common 2025-03-07 14:18:48 +01:00
Tristan Ross
2b28900a1f llvmPackages_{12,13,14,15,16,17,18,19,20,git}.lldb: move patches out of common 2025-03-07 14:18:28 +01:00
Tristan Ross
394ef62fb0 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libcxx: move patches out of common 2025-03-07 14:18:04 +01:00
Tristan Ross
c330ebeb4f llvmPackages_{12,13,14,15,16,17,18,19,20,git}.compiler-rt: move patches out of common 2025-03-07 14:17:38 +01:00
Tristan Ross
946113bbf7 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.openmp: move patches out of common 2025-03-07 14:16:58 +01:00
Tristan Ross
1a148262f4 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libunwind: move patches out of common 2025-03-07 14:16:40 +01:00
Tristan Ross
20e4f33f16 llvmPackages_{12,13,14,15,16,17,18,19,20,git}.lld: move patches out of common 2025-03-07 14:16:16 +01:00
Tristan Ross
e85abae0ae llvmPackages_{12,13,14,15,16,17,18,19,20,git}.clang: move patches out of common 2025-03-07 14:15:33 +01:00