Commit Graph

631 Commits

Author SHA1 Message Date
Alyssa Ross
67e23f7c95 llvmPackages*.bintools-unwrapped: set pname and version (#490414) 2026-02-14 15:40:33 +00:00
Moinak Bhattacharyya
9f63884d84 clang-tools: add python tools like clang-format-diff to clang-tools 2026-02-11 17:58:59 -06:00
Hythera
0bc058e5dc llvmPackages*.bintools-unwrapped: set pname and version 2026-02-09 10:17:56 +01:00
Alba Mendez
f6f258efa1 compiler-rt: enable build of libatomic
LLVM stdenvs lack a set of `__atomic_*` routines that compilers
sometimes rely on, making it impossible to build certain C programs in
them. The reason we lack these routines is that we're using neither
compiler-rt's implementation of them (which was disabled by default a
long time ago) nor gcc's implementation (libatomic). See #391740 for a
more detailed explanation and an example of program that cannot be built.

Since no particular preference was expressed as to which approach
should be used to solve this, I'm going with LLVM's implementation
and recommended setup, which seems to be used also in AIX, Fuchsia
and Apple platforms. This consists of enabling a CMake flag,
`COMPILER_RT_BUILD_STANDALONE_LIBATOMIC`, which causes the routines to
be built and shipped in a separate DSO (placing them in a DSO instead
of `builtins.a` is needed for correctness, as it ensures the lock
section is unique in memory).

As with the other builtins, I'm symlinking this DSO to `libatomic.so` so
that downstream packages don't need specific/complicated logic for LLVM.

Other details:
- For static platforms, since no dynamic linking is expected at all, it
  should be correct to ship the symbols in `builtins.a`.
  So, that's what I'm doing in those cases.
- Since v19, compiler-rt allows using pthread locks rather than ad-hoc
  ones for the atomic routines. Since this plays better with
  instrumentation, I'm enabling this whenever libc is available.
- It would be nice to put the DSO in a separate output / derivation, so
  that the rest of compiler-rt isn't pulled into the runtime closure,
  but it isn't high prio since compiler-rt doesn't pull in dependencies
  other than libc, libc++ and unwinder.

Fixes: https://github.com/NixOS/nixpkgs/issues/311930
2026-02-08 10:27:57 +01:00
nixpkgs-ci[bot]
84026606ab Merge staging-next into staging 2026-01-28 18:09:20 +00:00
Yuxuan Shui
0273d9cedf clang-tools: use $C_INCLUDE_PATH for C includes
$CPATH is taken to mean the same thing as -I by clang, whereas
$C_INCLUDE_PATH is -isystem. Using $CPATH means tools like clangd will
generate warnings for problems in system headers, which is undesirable.

See llvm/llvm-project#154015
2026-01-28 13:08:37 +00:00
Yuxuan Shui
10b12020a8 clang-tools: don't include C++ include paths in $CPATH 2026-01-28 13:08:35 +00:00
nixpkgs-ci[bot]
1c44e537b3 Merge staging-next into staging 2026-01-23 18:07:39 +00:00
Alyssa Ross
26e396ff32 llvmPackages.lldbPlugins.llef: 2.2.1 -> 2.2.2 (#478082) 2026-01-23 14:18:19 +00:00
Alyssa Ross
b01f305fe4 llvmPackages.libllvm: clean up rebuild avoidance (#479122) 2026-01-15 08:41:27 +00:00
Vladimír Čunát
7102b81df0 llvmPackages.libllvm: disable getMacOSHostVersion on LLVM < 21 (#478778) 2026-01-11 17:51:20 +00:00
Emily
0ecdff6a06 llvmPackages.libllvm: clean up rebuild avoidance 2026-01-10 18:55:55 +00:00
Emily
e44c4915d8 llvmPackages.libllvm: disable getMacOSHostVersion on LLVM < 21
This is breaking Hydra builds. The old comment about the CoreFoundation
framework is no longer relevant now that we always use the system
frameworks.
2026-01-10 18:34:18 +00:00
Emily
1865ae4be0 llvmPackages.libllvm: deduplicate Darwin patches 2026-01-10 18:32:40 +00:00
R. Ryantm
a57d1a8367 llvmPackages.lldbPlugins.llef: 2.2.1 -> 2.2.2 2026-01-08 14:13:52 +00:00
Stefan Frijters
099b274824 llvm: move LDFLAGS into env for structuredAttrs 2026-01-07 21:30:36 +01:00
nixpkgs-ci[bot]
1bab15e567 Merge staging-next into staging 2026-01-07 18:06:59 +00:00
Vladimír Čunát
9ab74f3ce3 glibc: 2.40-66 -> 2.42-47 (#379542) 2026-01-06 17:24:04 +00:00
Patryk Wychowaniec
09519744f1 clang-tools: add tests 2026-01-05 15:54:01 +02:00
Patryk Wychowaniec
f9c27d12ca clang-tools: add support for --query-driver 2026-01-05 15:53:46 +02:00
Maximilian Bosch
e69f759b53 llvmPackages_1{8,9}.compiler-rt: fix build w/ glibc-2.42
Failing Hydra build: https://hydra.nixos.org/build/308327424
2026-01-03 20:39:42 +01:00
R. Ryantm
54425f677b llvmPackages.lldbPlugins.llef: 2.0.0 -> 2.2.1 2026-01-01 22:04:13 +00:00
Alyssa Ross
89719dc42d llvmPackages.compiler-rt: fix nolibc build (#473755) 2025-12-29 12:25:47 +00:00
Theo Paris
8c4fa80840 llvmPackages.compiler-rt: fix nolibc build
Signed-off-by: Theo Paris <theo@theoparis.com>
Change-Id: Ieae2b7b767f744fac4a4f9fc46e949db6a6a6964
2025-12-23 19:25:40 -08:00
K900
b715e74ab2 Merge remote-tracking branch 'origin/master' into staging-next 2025-12-22 21:42:30 +03:00
Tristan Ross
1f0c5e638b llvmPackages_git: 22.0.0-unstable-2025-12-14 -> 22.0.0-unstable-2025-12-21 2025-12-21 19:44:49 -08:00
K900
85998c77b2 llvmPackages_{18,19}: fix build with gcc15 (#446556) 2025-12-18 06:59:41 +00:00
nixpkgs-ci[bot]
07c009ec89 Merge staging-next into staging 2025-12-11 18:06:04 +00:00
Tristan Ross
fad43d0aa1 llvmPackages_git: 22.0.0-unstable-2025-11-30 -> 22.0.0-unstable-2025-… (#468865) 2025-12-11 15:57:44 +00:00
Wolfgang Walther
46c0c0eae7 Merge branch 'staging-next' into staging 2025-12-10 18:42:31 +01:00
Ihar Hrachyshka
567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00
Tristan Ross
e237f3ede8 llvmPackages_git: 22.0.0-unstable-2025-11-30 -> 22.0.0-unstable-2025-12-07 2025-12-07 19:54:04 -08:00
K900
8b56bf20bb Merge remote-tracking branch 'origin/staging-next' into staging 2025-12-07 23:38:37 +03:00
David McFarland
d613d20a13 treewide: fix nix-env eval in cross 2025-12-04 19:44:19 -04:00
ghpzin
9ecbf0230d llvmPackages_{18,19}.mlir: fix build with gcc15
- add patch from 2 upstream commits that were not backported to llvm_18
and llvm_19:

41eb186fbb
Fixes build failure with gcc15:
```
In file included from /build/mlir-src-18.1.8/mlir/lib/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.cpp:9:
/build/mlir-src-18.1.8/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h:31:11:
error: 'int64_t' was not declared in this scope
   31 | FailureOr<int64_t> fullyComposeAndComputeConstantDelta(Value value1,
      |           ^~~~~~~
/build/mlir-src-18.1.8/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h:13:1:
note: 'int64_t' is defined in header '<cstdint>'; this is probably
fixable by adding '#include <cstdint>'
   12 | #include "mlir/Support/LogicalResult.h"
  +++ |+#include <cstdint>
   13 |
```

101109fc54
Fixes failure with gcc15:
```
In file included from /build/mlir-src-19.1.7/mlir/lib/Target/SPIRV/Deserialization/Deserialization.cpp:9:
/build/mlir-src-19.1.7/mlir/include/mlir/Target/SPIRV/Deserialization.h:29:51:
error: 'uint32_t' was not declared in this scope
   29 | OwningOpRef<spirv::ModuleOp> deserialize(ArrayRef<uint32_t> binary,
      |                                                   ^~~~~~~~
/build/mlir-src-19.1.7/mlir/include/mlir/Target/SPIRV/Deserialization.h:18:1:
note: 'uint32_t' is defined in header '<cstdint>'; this is probably
fixable by adding '#include <cstdint>'
   17 | #include "mlir/Support/LLVM.h"
  +++ |+#include <cstdint>
   18 |
```

First patch can be applied with `fetchpatch`, but only on llvm_19, because
of changed include line right above.
So use 2 versions of combined patches with 2 commits.
2025-12-04 07:21:16 +03:00
ghpzin
3d2200b18c llvmPackages_18.lldb: fix build with gcc15
- add patch from upstream commit that was not backported to llvm_18:

bb59f04e7e
Fixes build failure with gcc15:
```
In file included from /build/lldb-src-18.1.8/lldb/source/Utility/AddressableBits.cpp:9:
/build/lldb-src-18.1.8/lldb/include/lldb/Utility/AddressableBits.h:25:27:
error: 'uint32_t' has not been declared
   25 |   void SetAddressableBits(uint32_t addressing_bits);
      |                           ^~~~~~~~
/build/lldb-src-18.1.8/lldb/include/lldb/Utility/AddressableBits.h:13:1:
note: 'uint32_t' is defined in header '<cstdint>'; this is probably
fixable by adding '#include <cstdint>'
   12 | #include "lldb/lldb-forward.h"
  +++ |+#include <cstdint>
   13 |
```

Cannot use `fetchpatch` because patch does not apply on llvm_18
(no `#include "lldb/lldb-public.h"` line on llvm_18).
2025-12-04 07:21:16 +03:00
ghpzin
e66ff4c802 llvmPackages_18.llvm: fix build with gcc15
- add combined patch from 2 upstream commits that were not backported
to llvm_18:

8f39502b85
Fixes build failure with gcc15:
```
In file included from /build/llvm-src-18.1.8/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.cpp:14:
/build/llvm-src-18.1.8/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h:44:43:
error: 'uint8_t' has not been declared
   44 | createAMDGPUELFObjectWriter(bool Is64Bit, uint8_t OSABI,
      |                                           ^~~~~~~
/build/llvm-src-18.1.8/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h:19:1:
note: 'uint8_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   18 | #include <memory>
  +++ |+#include <cstdint>
   19 |
```

7abf44069a
Fixes build failure with gcc15:
```
In file included from /build/llvm-src-18.1.8/llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h:19,
                 from /build/llvm-src-18.1.8/llvm/lib/Target/X86/MCTargetDesc/X86EncodingOptimization.cpp:14:
/build/llvm-src-18.1.8/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h:86:50:
error: 'uint64_t' has not been declared
   86 |                               int MemoryOperand, uint64_t TSFlags);
      |                                                  ^~~~~~~~
/build/llvm-src-18.1.8/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h:18:1:
note: 'uint64_t' is defined in header '<cstdint>'; this is probably
fixable by adding '#include <cstdint>'
   17 | #include <string>
  +++ |+#include <cstdint>
   18 |
```

Cannot use `fetchpatch` because second patch does not apply on llvm_18,
no `#include "llvm/ADT/SmallVector.h"` line present on llvm_18.
So vendor combined patch from 2 commits.
2025-12-04 07:21:16 +03:00
Randy Eckenrode
d46fa2640e llvmPackages.clang-tools: add support for -cxx-isystem
This is necessary after https://github.com/NixOS/nixpkgs/pull/445095,
which moved libc++ to -cxx-isystem to improve compatibility with build
systems that invoke `clang` to compile C++ code.
2025-11-17 20:35:07 -05: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
Wolfgang Walther
5e1f5b623b Merge branch 'staging-next' into staging 2025-10-05 11:40:56 +02:00
K900
e93c560b79 Merge remote-tracking branch 'origin/master' into staging-next 2025-10-05 12:17:08 +03:00
Wolfgang Walther
91a8fee3aa treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
2025-10-05 10:52:03 +02:00
nixpkgs-ci[bot]
e23d356469 Merge staging-next into staging 2025-10-05 00:18:23 +00:00
Alyssa Ross
6f7816d63e llvmPackages.compiler-rt: clean up libxcrypt fix (#447574) 2025-10-04 20:12:01 +02:00
K900
f8d669f413 Merge remote-tracking branch 'origin/master' into staging-next 2025-10-04 21:10:21 +03:00