llvmPackages_15: apply some patches from llvmPackages_14

See #194634 for details.

PRs:
  - #191372
  - #190936
  - #82131
  - #199844
  - #197674
  - #184408
  - #193004
This commit is contained in:
Rahul Butani 2023-01-08 06:12:31 -08:00
parent 201ef33028
commit 81ef82a029
No known key found for this signature in database
8 changed files with 22 additions and 10 deletions

View File

@ -84,6 +84,7 @@ let
fi
mv $out/share/clang/*.py $python/share/clang
rm $out/bin/c-index-test
patchShebangs $python/bin
mkdir -p $dev/bin
cp bin/clang-tblgen $dev/bin
@ -108,6 +109,7 @@ let
of tools that can be built using the Clang frontend as a library to
parse C/C++ code.
'';
mainProgram = "clang";
};
} // lib.optionalAttrs enableManpages {
pname = "clang-manpages";

View File

@ -1,6 +1,7 @@
{ lib, stdenv, llvm_meta, version
, monorepoSrc, runCommand
, cmake, python3, libllvm, libcxxabi, libxcrypt
, doFakeLibgcc ? stdenv.hostPlatform.isFreeBSD
}:
let
@ -46,6 +47,8 @@ stdenv.mkDerivation {
"-DCOMPILER_RT_BUILD_PROFILE=OFF"
"-DCOMPILER_RT_BUILD_MEMPROF=OFF"
"-DCOMPILER_RT_BUILD_ORC=OFF" # may be possible to build with musl if necessary
] ++ lib.optionals (useLLVM || bareMetal) [
"-DCOMPILER_RT_BUILD_PROFILE=OFF"
] ++ lib.optionals ((useLLVM && !haveLibc) || bareMetal) [
"-DCMAKE_C_COMPILER_WORKS=ON"
"-DCMAKE_CXX_COMPILER_WORKS=ON"
@ -107,6 +110,8 @@ stdenv.mkDerivation {
ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o
ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o
ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o
'' + lib.optionalString doFakeLibgcc ''
ln -s $out/lib/freebsd/libclang_rt.builtins-*.a $out/lib/libgcc.a
'';
meta = llvm_meta // {

View File

@ -3,6 +3,7 @@
, libxml2, python3, isl, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith
, buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross
, targetLlvm
# This is the default binutils, but with *this* version of LLD rather
# than the default LLVM verion's, if LLD is the choice. We use these for
# the `useLLVM` bootstrapping below.
@ -166,7 +167,7 @@ let
]
++ lib.optional (!stdenv.targetPlatform.isWasm) "--unwindlib=libunwind"
++ lib.optional
(!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false)
(!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && stdenv.targetPlatform.useLLVM or false)
"-lunwind"
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
};
@ -273,7 +274,7 @@ let
};
openmp = callPackage ./openmp {
inherit llvm_meta;
inherit llvm_meta targetLlvm;
};
});

View File

@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
'';
nativeBuildInputs = [ cmake python3 ];
buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.hostPlatform.isWasm) libunwind;
cmakeFlags = [
"-DLLVM_ENABLE_RUNTIMES=libcxxabi"

View File

@ -35,6 +35,7 @@ stdenv.mkDerivation rec {
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
];
LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-Wl,-z,stack-size=2097152";
outputs = [ "out" "lib" "dev" ];

View File

@ -18,10 +18,10 @@
, debugVersion ? false
, enableManpages ? false
, enableSharedLibraries ? !stdenv.hostPlatform.isStatic
, enablePFM ? !(stdenv.isDarwin
|| stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245
|| stdenv.isAarch32 # broken for the armv7l builder
)
, enablePFM ? stdenv.isLinux /* PFM only supports Linux */
# broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245
# broken for the armv7l builder
&& !stdenv.hostPlatform.isAarch
, enablePolly ? false
} @args:
@ -141,6 +141,7 @@ in stdenv.mkDerivation (rec {
# Disables building of shared libs, -fPIC is still injected by cc-wrapper
"-DLLVM_ENABLE_PIC=OFF"
"-DLLVM_BUILD_STATIC=ON"
"-DLLVM_LINK_LLVM_DYLIB=off"
# libxml2 needs to be disabled because the LLVM build system ignores its .la
# file and doesn't link zlib as well.
# https://github.com/ClangBuiltLinux/tc-build/issues/150#issuecomment-845418812

View File

@ -5,6 +5,7 @@
, runCommand
, cmake
, llvm
, targetLlvm
, lit
, clang-unwrapped
, perl
@ -33,7 +34,9 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake perl pkg-config lit ];
buildInputs = [ llvm ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];
# Unsup:Pass:XFail:Fail
# 26:267:16:8

View File

@ -15140,8 +15140,7 @@ with pkgs;
inherit (stdenvAdapters) overrideCC;
buildLlvmTools = buildPackages.llvmPackages_15.tools;
targetLlvmLibraries = targetPackages.llvmPackages_15.libraries or llvmPackages_15.libraries;
} // lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.hostPlatform == stdenv.buildPlatform && buildPackages.stdenv.cc.isGNU) {
stdenv = gcc7Stdenv;
targetLlvm = targetPackages.llvmPackages_15.llvm or llvmPackages_15.llvm;
}));
llvmPackages_latest = llvmPackages_14;