Skip to content

Commit

Permalink
Merge pull request #303948 from ExpidusOS/feat/llvm-git-commonify-clang
Browse files Browse the repository at this point in the history
llvmPackages_{12,13,14,15,16,17,18,git}: use common clang
  • Loading branch information
wegank authored Apr 14, 2024
2 parents 62b4744 + dc4d5c2 commit 6da46d6
Show file tree
Hide file tree
Showing 15 changed files with 206 additions and 867 deletions.
132 changes: 0 additions & 132 deletions pkgs/development/compilers/llvm/12/clang/default.nix

This file was deleted.

16 changes: 13 additions & 3 deletions pkgs/development/compilers/llvm/12/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lowPrio, newScope, pkgs, lib, stdenv, cmake
, preLibcCrossHeaders
, substitute, fetchFromGitHub, fetchpatch
, substitute, substituteAll, fetchFromGitHub, fetchpatch
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
, buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross
Expand Down Expand Up @@ -56,7 +56,7 @@ let
then tools.bintools
else bootBintools;

in {
in rec {

libllvm = callPackage ./llvm {
inherit llvm_meta;
Expand All @@ -66,7 +66,17 @@ let
# we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
llvm = tools.libllvm;

libclang = callPackage ./clang {
libclang = callPackage ../common/clang {
src = fetch "clang" "0px4gl27az6cdz6adds89qzdwb1cqpjsfvrldbz9qvpmphrj34bf";
patches = [
./clang/purity.patch
# https://reviews.llvm.org/D51899
./clang/gnu-install-dirs.patch
(substituteAll {
src = ../common/clang/clang-11-15-LLVMgold-path.patch;
libllvmLibdir = "${libllvm.lib}/lib";
})
];
inherit clang-tools-extra_src llvm_meta;
};

Expand Down
126 changes: 0 additions & 126 deletions pkgs/development/compilers/llvm/13/clang/default.nix

This file was deleted.

21 changes: 18 additions & 3 deletions pkgs/development/compilers/llvm/13/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lowPrio, newScope, pkgs, lib, stdenv, cmake
, preLibcCrossHeaders
, fetchpatch
, libxml2, python3, isl, fetchFromGitHub, substitute, overrideCC, wrapCCWith, wrapBintoolsWith
, libxml2, python3, isl, fetchFromGitHub, substitute, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith
, buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross
, targetLlvm
Expand Down Expand Up @@ -82,7 +82,7 @@ in let
then tools.bintools
else bootBintools;

in {
in rec {

libllvm = callPackage ./llvm {
inherit llvm_meta;
Expand All @@ -92,7 +92,22 @@ in let
# we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
llvm = tools.libllvm;

libclang = callPackage ./clang {
libclang = callPackage ../common/clang {
patches = [
./clang/purity.patch
# https://reviews.llvm.org/D51899
./clang/gnu-install-dirs.patch
# Revert of https://reviews.llvm.org/D100879
# The malloc alignment assumption is incorrect for jemalloc and causes
# mis-compilation in firefox.
# See: https://bugzilla.mozilla.org/show_bug.cgi?id=1741454
./clang/revert-malloc-alignment-assumption.patch
../common/clang/add-nostdlibinc-flag.patch
(substituteAll {
src = ../common/clang/clang-11-15-LLVMgold-path.patch;
libllvmLibdir = "${libllvm.lib}/lib";
})
];
inherit llvm_meta;
};

Expand Down
Loading

0 comments on commit 6da46d6

Please sign in to comment.