LLVM: Difference between revisions

imported>NiklasGollenstede
add python3 depenedency, which is required for newer versions of llvm
Klinger (talk | contribs)
m Category:Applications Category:Languages removed, Category:Development added
 
(One intermediate revision by one other user not shown)
Line 62: Line 62:
</syntaxHighlight>
</syntaxHighlight>


[[Category:Applications]]
== Building Nixpkgs/NixOS with LLVM ==
[[Category:Languages]]
It is technically possible to build Nixpkgs and NixOS with LLVM, however many packages are broken due to the differences between GCC and Clang. Tristan Ross, one of the maintainers of LLVM, started a project back in June of 2024 to improve the state of LLVM compiled packages. Currently, the project is located on GitHub at [https://github.com/RossComputerGuy/nixpkgs-llvm-ws RossComputerGuy/nixpkgs-llvm-ws]. Many packages have been fixed upstream but it is best to try the Flake as not all fixes are merged.
 
=== Using LLVM in Nixpkgs without the Nixpkgs LLVM Workspace ===
To use LLVM to build packages in Nix, it can be done by either using the <code>pkgsLLVM</code> attribute or by overriding a derivation and changing out the <code>stdenv</code>. Changing out the <code>stdenv</code> is as simple as this:<syntaxhighlight lang="nix">
pkgs.hello.override {
  stdenv = pkgs.llvmPackages.stdenv;
}
</syntaxhighlight>
[[Category:Development]]