LLVM: Difference between revisions

imported>Igodlab
m libcxx & libcxxabi should be enabled in -DLLVM_ENABLE_RUNTIMES rather than -DLLVM_ENABLE_PROJECTS
Klinger (talk | contribs)
m Category:Applications Category:Languages removed, Category:Development added
 
(2 intermediate revisions by 2 users not shown)
Line 14: Line 14:
   buildInputs = [
   buildInputs = [
     bashInteractive
     bashInteractive
    python3
     ninja
     ninja
     cmake
     cmake
Line 61: 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]]