mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 04:45:39 +00:00
Merge pull request #273788 from sternenseemann/llvmgold-clang-16-and-above
This commit is contained in:
commit
8e5a5551e8
@ -50,7 +50,7 @@ let
|
||||
# https://reviews.llvm.org/D51899
|
||||
./gnu-install-dirs.patch
|
||||
(substituteAll {
|
||||
src = ../../clang-11-12-LLVMgold-path.patch;
|
||||
src = ../../clang-11-15-LLVMgold-path.patch;
|
||||
libllvmLibdir = "${libllvm.lib}/lib";
|
||||
})
|
||||
];
|
||||
|
@ -47,7 +47,7 @@ let
|
||||
# https://reviews.llvm.org/D51899
|
||||
./gnu-install-dirs.patch
|
||||
(substituteAll {
|
||||
src = ../../clang-11-12-LLVMgold-path.patch;
|
||||
src = ../../clang-11-15-LLVMgold-path.patch;
|
||||
libllvmLibdir = "${libllvm.lib}/lib";
|
||||
})
|
||||
];
|
||||
|
@ -43,7 +43,7 @@ let
|
||||
./revert-malloc-alignment-assumption.patch
|
||||
../../common/clang/add-nostdlibinc-flag.patch
|
||||
(substituteAll {
|
||||
src = ../../clang-11-12-LLVMgold-path.patch;
|
||||
src = ../../clang-11-15-LLVMgold-path.patch;
|
||||
libllvmLibdir = "${libllvm.lib}/lib";
|
||||
})
|
||||
];
|
||||
|
@ -46,7 +46,7 @@ let
|
||||
./gnu-install-dirs.patch
|
||||
../../common/clang/add-nostdlibinc-flag.patch
|
||||
(substituteAll {
|
||||
src = ../../clang-11-12-LLVMgold-path.patch;
|
||||
src = ../../clang-11-15-LLVMgold-path.patch;
|
||||
libllvmLibdir = "${libllvm.lib}/lib";
|
||||
})
|
||||
];
|
||||
|
@ -52,7 +52,7 @@ let
|
||||
./gnu-install-dirs.patch
|
||||
../../common/clang/add-nostdlibinc-flag.patch
|
||||
(substituteAll {
|
||||
src = ../../clang-11-12-LLVMgold-path.patch;
|
||||
src = ../../clang-11-15-LLVMgold-path.patch;
|
||||
libllvmLibdir = "${libllvm.lib}/lib";
|
||||
})
|
||||
];
|
||||
|
@ -1,6 +1,6 @@
|
||||
{ lib, stdenv, llvm_meta
|
||||
, monorepoSrc, runCommand
|
||||
, cmake, ninja, libxml2, libllvm, version, python3
|
||||
, substituteAll, cmake, ninja, libxml2, libllvm, version, python3
|
||||
, buildLlvmTools
|
||||
, fixDarwinDylibNames
|
||||
, enableManpages ? false
|
||||
@ -51,11 +51,10 @@ let
|
||||
# https://reviews.llvm.org/D51899
|
||||
./gnu-install-dirs.patch
|
||||
../../common/clang/add-nostdlibinc-flag.patch
|
||||
# FIMXE: do we need this patch?
|
||||
# (substituteAll {
|
||||
# src = ../../clang-11-12-LLVMgold-path.patch;
|
||||
# libllvmLibdir = "${libllvm.lib}/lib";
|
||||
# })
|
||||
(substituteAll {
|
||||
src = ../../clang-at-least-16-LLVMgold-path.patch;
|
||||
libllvmLibdir = "${libllvm.lib}/lib";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
|
@ -325,7 +325,8 @@ in
|
||||
"-DSPHINX_OUTPUT_MAN=ON"
|
||||
"-DSPHINX_OUTPUT_HTML=OFF"
|
||||
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
|
||||
] ++ optionals (false) [
|
||||
] ++ optionals enableGoldPlugin [
|
||||
# For LLVMgold plugin
|
||||
"-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
|
||||
] ++ optionals isDarwin [
|
||||
"-DLLVM_ENABLE_LIBCXX=ON"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{ lib, stdenv, llvm_meta
|
||||
, monorepoSrc, runCommand
|
||||
, cmake, ninja, libxml2, libllvm, version, python3
|
||||
, substituteAll, cmake, ninja, libxml2, libllvm, version, python3
|
||||
, buildLlvmTools
|
||||
, fixDarwinDylibNames
|
||||
, enableManpages ? false
|
||||
@ -52,11 +52,10 @@ let
|
||||
# https://reviews.llvm.org/D51899
|
||||
./gnu-install-dirs.patch
|
||||
../../common/clang/add-nostdlibinc-flag.patch
|
||||
# FIMXE: do we need this patch?
|
||||
# (substituteAll {
|
||||
# src = ../../clang-11-12-LLVMgold-path.patch;
|
||||
# libllvmLibdir = "${libllvm.lib}/lib";
|
||||
# })
|
||||
(substituteAll {
|
||||
src = ../../clang-at-least-16-LLVMgold-path.patch;
|
||||
libllvmLibdir = "${libllvm.lib}/lib";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
|
@ -8,8 +8,7 @@
|
||||
, python3
|
||||
, python3Packages
|
||||
, libffi
|
||||
# TODO: Gold plugin on LLVM16 has a severe memory corruption bug: https://github.com/llvm/llvm-project/issues/61350.
|
||||
, enableGoldPlugin ? false
|
||||
, enableGoldPlugin ? true
|
||||
, libbfd
|
||||
, libpfm
|
||||
, libxml2
|
||||
@ -66,8 +65,8 @@ let
|
||||
else python3;
|
||||
|
||||
in
|
||||
assert (lib.assertMsg (!enableGoldPlugin) "Gold plugin cannot be enabled on LLVM16 due to a upstream issue: https://github.com/llvm/llvm-project/issues/61350");
|
||||
stdenv.mkDerivation (rec {
|
||||
|
||||
stdenv.mkDerivation (rec {
|
||||
pname = "llvm";
|
||||
inherit version;
|
||||
|
||||
@ -325,7 +324,8 @@ in
|
||||
"-DSPHINX_OUTPUT_MAN=ON"
|
||||
"-DSPHINX_OUTPUT_HTML=OFF"
|
||||
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
|
||||
] ++ optionals (false) [
|
||||
] ++ optionals enableGoldPlugin [
|
||||
# For LLVMgold plugin
|
||||
"-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
|
||||
] ++ optionals isDarwin [
|
||||
"-DLLVM_ENABLE_LIBCXX=ON"
|
||||
|
@ -0,0 +1,14 @@
|
||||
diff --git a/lib/Driver/ToolChains/CommonArgs.cpp b/lib/Driver/ToolChains/CommonArgs.cpp
|
||||
index 34640b3c450d..93c4a4f4ec5c 100644
|
||||
--- a/lib/Driver/ToolChains/CommonArgs.cpp
|
||||
+++ b/lib/Driver/ToolChains/CommonArgs.cpp
|
||||
@@ -589,8 +589,7 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
|
||||
#endif
|
||||
|
||||
SmallString<1024> Plugin;
|
||||
- llvm::sys::path::native(Twine(D.Dir) +
|
||||
- "/../" CLANG_INSTALL_LIBDIR_BASENAME +
|
||||
+ llvm::sys::path::native(Twine("@libllvmLibdir@") +
|
||||
PluginName + Suffix,
|
||||
Plugin);
|
||||
CmdArgs.push_back(Args.MakeArgString(Twine(PluginPrefix) + Plugin));
|
@ -1,6 +1,6 @@
|
||||
{ lib, stdenv, llvm_meta
|
||||
, monorepoSrc, runCommand
|
||||
, cmake, ninja, libxml2, libllvm, version, python3
|
||||
, substituteAll, cmake, ninja, libxml2, libllvm, version, python3
|
||||
, buildLlvmTools
|
||||
, fixDarwinDylibNames
|
||||
, enableManpages ? false
|
||||
@ -52,11 +52,10 @@ let
|
||||
# https://reviews.llvm.org/D51899
|
||||
./gnu-install-dirs.patch
|
||||
../../common/clang/add-nostdlibinc-flag.patch
|
||||
# FIMXE: do we need this patch?
|
||||
# (substituteAll {
|
||||
# src = ../../clang-11-12-LLVMgold-path.patch;
|
||||
# libllvmLibdir = "${libllvm.lib}/lib";
|
||||
# })
|
||||
(substituteAll {
|
||||
src = ../../clang-at-least-16-LLVMgold-path.patch;
|
||||
libllvmLibdir = "${libllvm.lib}/lib";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
|
@ -8,8 +8,7 @@
|
||||
, python3
|
||||
, python3Packages
|
||||
, libffi
|
||||
# TODO: Gold plugin on LLVM16 has a severe memory corruption bug: https://github.com/llvm/llvm-project/issues/61350.
|
||||
, enableGoldPlugin ? false
|
||||
, enableGoldPlugin ? true
|
||||
, libbfd
|
||||
, libpfm
|
||||
, libxml2
|
||||
@ -66,8 +65,8 @@ let
|
||||
else python3;
|
||||
|
||||
in
|
||||
assert (lib.assertMsg (!enableGoldPlugin) "Gold plugin cannot be enabled on LLVM16 due to a upstream issue: https://github.com/llvm/llvm-project/issues/61350");
|
||||
stdenv.mkDerivation (rec {
|
||||
|
||||
stdenv.mkDerivation (rec {
|
||||
pname = "llvm";
|
||||
inherit version;
|
||||
|
||||
@ -325,7 +324,7 @@ in
|
||||
"-DSPHINX_OUTPUT_MAN=ON"
|
||||
"-DSPHINX_OUTPUT_HTML=OFF"
|
||||
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
|
||||
] ++ optionals (false) [
|
||||
] ++ optionals enableGoldPlugin [
|
||||
"-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
|
||||
] ++ optionals isDarwin [
|
||||
"-DLLVM_ENABLE_LIBCXX=ON"
|
||||
|
Loading…
Reference in New Issue
Block a user