diff options
Diffstat (limited to 'pkgs/development/compilers/llvm/13/default.nix')
-rw-r--r-- | pkgs/development/compilers/llvm/13/default.nix | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/pkgs/development/compilers/llvm/13/default.nix b/pkgs/development/compilers/llvm/13/default.nix index ecdbd14e98e74..9348e19e6de39 100644 --- a/pkgs/development/compilers/llvm/13/default.nix +++ b/pkgs/development/compilers/llvm/13/default.nix @@ -82,9 +82,49 @@ in let then tools.bintools else bootBintools; - in rec { + in { + + libllvm = callPackage ../common/llvm { + patches = [ + # When cross-compiling we configure llvm-config-native with an approximation + # of the flags used for the normal LLVM build. To avoid the need for building + # a native libLLVM.so (which would fail) we force llvm-config to be linked + # statically against the necessary LLVM components always. + ../common/llvm/llvm-config-link-static.patch + + ./llvm/gnu-install-dirs.patch + + # Fix random compiler crashes: https://bugs.llvm.org/show_bug.cgi?id=50611 + (fetchpatch { + url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/4764a4f8c920912a2bfd8b0eea57273acfe0d8a8/trunk/no-strict-aliasing-DwarfCompileUnit.patch"; + sha256 = "18l6mrvm2vmwm77ckcnbjvh6ybvn72rhrb799d4qzwac4x2ifl7g"; + stripLen = 1; + }) + + # Fix musl build. + (fetchpatch { + url = "https://github.com/llvm/llvm-project/commit/5cd554303ead0f8891eee3cd6d25cb07f5a7bf67.patch"; + relative = "llvm"; + hash = "sha256-XPbvNJ45SzjMGlNUgt/IgEvM2dHQpDOe6woUJY+nUYA="; + }) - libllvm = callPackage ./llvm { + # Backport gcc-13 fixes with missing includes. + (fetchpatch { + name = "signals-gcc-13.patch"; + url = "https://github.com/llvm/llvm-project/commit/ff1681ddb303223973653f7f5f3f3435b48a1983.patch"; + hash = "sha256-CXwYxQezTq5vdmc8Yn88BUAEly6YZ5VEIA6X3y5NNOs="; + stripLen = 1; + }) + (fetchpatch { + name = "base64-gcc-13.patch"; + url = "https://github.com/llvm/llvm-project/commit/5e9be93566f39ee6cecd579401e453eccfbe81e5.patch"; + hash = "sha256-PAwrVrvffPd7tphpwCkYiz+67szPRzRB2TXBvKfzQ7U="; + stripLen = 1; + }) + ]; + pollyPatches = [ + ./llvm/gnu-install-dirs-polly.patch + ]; inherit llvm_meta; }; @@ -105,7 +145,7 @@ in let ../common/clang/add-nostdlibinc-flag.patch (substituteAll { src = ../common/clang/clang-11-15-LLVMgold-path.patch; - libllvmLibdir = "${libllvm.lib}/lib"; + libllvmLibdir = "${tools.libllvm.lib}/lib"; }) ]; inherit llvm_meta; |