llvmPackages_{12,13,14,15,16,17}: drop (#440273)

Changed files
+905 -6944
doc
release-notes
pkgs
by-name
bf
da
ho
hobbes
oc
oclgrind
qr
qrscan
sh
shader-slang
sp
spirv-llvm-translator
wa
development
compilers
cone
fpc
ghc
llvm
12
13
14
15
16
17
18
common
mrustc
haskell-modules
tools
analysis
test
top-level
+2
doc/release-notes/rl-2511.section.md
···
- GCC 9, 10, 11, and 12 have been removed, as they have reached end‐of‐life upstream and are no longer supported.
+
- LLVM 12, 13, 14, 15, 16, and 17 have been removed, as they have reached end‐of‐life upstream and are no longer supported.
+
- GHCJS 8.10, exposed via `haskell.compiler.ghcjs` and `haskell.compiler.ghcjs810`, has been removed. Downstream users should migrate their projects to the new JavaScript backend of GHC proper which can be used via `pkgsCross.ghcjs` from Nixpkgs. Haskell packaging code, like `haskellPackages.mkDerivation`, `ghcWithPackages` and `hoogleWithPackages`, also no longer supports GHCJS.
- GHC 8.6, 8.10, 9.0, 9.2, and their package sets have been removed.
-44
pkgs/by-name/bf/bfc/package.nix
···
-
{
-
lib,
-
rustPlatform,
-
fetchFromGitHub,
-
llvmPackages_13,
-
libxml2,
-
ncurses,
-
zlib,
-
stdenv,
-
}:
-
-
rustPlatform.buildRustPackage rec {
-
pname = "bfc";
-
version = "1.12.0";
-
-
src = fetchFromGitHub {
-
owner = "Wilfred";
-
repo = "bfc";
-
rev = version;
-
hash = "sha256-5pcvwCtXWEexvV3TS62dZ6Opg8ANP2L8B0Z8u/OQENU=";
-
};
-
-
cargoHash = "sha256-S8Fy0PRSUftljcX34Sj8MmlPW7Oob2yayPUA1RRxf8E=";
-
-
buildInputs = [
-
libxml2
-
ncurses
-
zlib
-
];
-
-
env.LLVM_SYS_130_PREFIX = llvmPackages_13.llvm.dev;
-
-
# process didn't exit successfully: <...> SIGSEGV
-
doCheck = false;
-
-
meta = with lib; {
-
description = "Industrial-grade brainfuck compiler";
-
mainProgram = "bfc";
-
homepage = "https://bfc.wilfred.me.uk";
-
license = licenses.gpl2Plus;
-
maintainers = with maintainers; [ figsoda ];
-
broken = stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux;
-
};
-
}
-53
pkgs/by-name/da/dale/package.nix
···
-
{
-
lib,
-
stdenv,
-
fetchFromGitHub,
-
cmake,
-
pkg-config,
-
libffi,
-
llvm_13,
-
perl,
-
}:
-
-
stdenv.mkDerivation {
-
pname = "dale";
-
version = "20220411";
-
-
src = fetchFromGitHub {
-
owner = "tomhrr";
-
repo = "dale";
-
rev = "7386ef2d8912c60c6fb157a1e5cd772e15eaf658";
-
sha256 = "sha256-LNWqrFuEjtL7zuPTBfe4qQWr8IrT/ldQWSeDTK3Wqmo=";
-
};
-
-
nativeBuildInputs = [
-
cmake
-
pkg-config
-
llvm_13.dev
-
];
-
buildInputs = [
-
libffi
-
llvm_13
-
];
-
-
nativeCheckInputs = [ perl ];
-
-
checkTarget = "tests";
-
-
meta = with lib; {
-
description = "Lisp-flavoured C";
-
longDescription = ''
-
Dale is a system (no GC) programming language that uses
-
S-expressions for syntax and supports syntactic macros.
-
'';
-
homepage = "https://github.com/tomhrr/dale";
-
license = licenses.bsd3;
-
maintainers = with maintainers; [ amiloradovsky ];
-
platforms = [
-
"i686-linux"
-
"x86_64-linux"
-
"aarch64-linux"
-
];
-
# failed on Darwin: linker couldn't find the FFI lib
-
};
-
}
-64
pkgs/by-name/ho/hobbes/package.nix
···
-
{
-
lib,
-
stdenv,
-
llvmPackages,
-
fetchFromGitHub,
-
cmake,
-
llvm_12,
-
ncurses,
-
readline,
-
zlib,
-
libxml2,
-
python3,
-
}:
-
llvmPackages.stdenv.mkDerivation {
-
pname = "hobbes";
-
version = "0-unstable-2025-04-23";
-
-
src = fetchFromGitHub {
-
owner = "morganstanley";
-
repo = "hobbes";
-
rev = "0829030be03d47f91075cbebd0c9565f44bf9911";
-
hash = "sha256-GZ26XL4++2MWQED2tVWeJ8HFcFQUXnXZ3+JCgdlAXNo=";
-
};
-
-
CXXFLAGS = [
-
"-Wno-error=missing-template-arg-list-after-template-kw"
-
"-Wno-error=deprecated-copy"
-
];
-
-
nativeBuildInputs = [
-
cmake
-
];
-
-
buildInputs = [
-
llvm_12
-
ncurses
-
readline
-
zlib
-
libxml2
-
python3
-
];
-
-
doCheck = true;
-
checkTarget = "test";
-
-
meta = with lib; {
-
broken = stdenv.hostPlatform.isDarwin;
-
description = "Language and an embedded JIT compiler";
-
longDescription = ''
-
Hobbes is a a language, embedded compiler, and runtime for efficient
-
dynamic expression evaluation, data storage and analysis.
-
'';
-
homepage = "https://github.com/morganstanley/hobbes";
-
license = licenses.asl20;
-
maintainers = with maintainers; [
-
kthielen
-
thmzlt
-
];
-
platforms = [
-
"x86_64-linux"
-
"x86_64-darwin"
-
];
-
};
-
}
-42
pkgs/by-name/oc/oclgrind/package.nix
···
-
{
-
lib,
-
stdenv,
-
fetchFromGitHub,
-
cmake,
-
llvmPackages_13,
-
readline,
-
python3,
-
}:
-
-
stdenv.mkDerivation rec {
-
pname = "oclgrind";
-
version = "21.10";
-
-
src = fetchFromGitHub {
-
owner = "jrprice";
-
repo = "oclgrind";
-
rev = "v${version}";
-
sha256 = "sha256-DGCF7X2rPV1w9guxg2bMylRirXQgez24sG7Unlct3ow=";
-
};
-
-
nativeBuildInputs = [ cmake ];
-
nativeCheckInputs = [ python3 ];
-
buildInputs = [
-
llvmPackages_13.llvm
-
llvmPackages_13.clang-unwrapped
-
readline
-
];
-
-
cmakeFlags = [
-
"-DCLANG_ROOT=${llvmPackages_13.clang-unwrapped}"
-
(lib.cmakeBool "CMAKE_SKIP_RPATH" true)
-
];
-
-
meta = with lib; {
-
description = "OpenCL device simulator and debugger";
-
homepage = "https://github.com/jrprice/oclgrind";
-
license = licenses.bsd3;
-
platforms = platforms.linux;
-
maintainers = with maintainers; [ athas ];
-
};
-
}
-45
pkgs/by-name/qr/qrscan/package.nix
···
-
{
-
clang_15,
-
lib,
-
rustPlatform,
-
fetchFromGitHub,
-
stdenv,
-
}:
-
-
rustPlatform.buildRustPackage rec {
-
pname = "qrscan";
-
version = "0.1.9";
-
-
src = fetchFromGitHub {
-
owner = "sayanarijit";
-
repo = "qrscan";
-
rev = "v${version}";
-
hash = "sha256-nAUZUE7NppsCAV8UyR8+OkikT4nJtnamsSVeyNz21EQ=";
-
};
-
-
nativeBuildInputs = [
-
(rustPlatform.bindgenHook.overrideAttrs {
-
libclang = clang_15.cc.lib;
-
})
-
];
-
-
cargoHash = "sha256-hBDB/Cp8JTk9hF3qDBCb7LicUZdpXHm2i2dsuw5geO4=";
-
-
checkFlags = [
-
# requires filesystem write access
-
"--skip=tests::test_export_files"
-
"--skip=tests::test_scan_from_stdin"
-
"--skip=tests::test_scan_jpeg_file"
-
"--skip=tests::test_scan_no_content"
-
"--skip=tests::test_scan_png_file"
-
];
-
-
meta = with lib; {
-
description = "Scan a QR code in the terminal using the system camera or a given image";
-
mainProgram = "qrscan";
-
homepage = "https://github.com/sayanarijit/qrscan";
-
license = licenses.mit;
-
broken = stdenv.hostPlatform.isDarwin;
-
maintainers = [ maintainers.sayanarijit ];
-
};
-
}
+6 -5
pkgs/by-name/sh/shader-slang/package.nix
···
libX11,
glslang,
unordered_dense,
-
llvmPackages_14,
+
llvmPackages,
versionCheckHook,
gitUpdater,
···
libX11
]
++ lib.optionals withLLVM [
-
# Slang only supports LLVM 14:
-
# https://github.com/shader-slang/slang/blob/v2025.15/docs/building.md#llvm-support
-
llvmPackages_14.llvm
-
llvmPackages_14.libclang
+
llvmPackages.llvm
+
llvmPackages.libclang
]
++ lib.optionals withGlslang [
# SPIRV-tools is included in glslang.
···
maintainers = with lib.maintainers; [ niklaskorz ];
mainProgram = "slangc";
platforms = lib.platforms.all;
+
# Slang only supports LLVM 14:
+
# https://github.com/shader-slang/slang/blob/v2025.15/docs/building.md#llvm-support
+
broken = withLLVM;
};
})
+2 -28
pkgs/by-name/sp/spirv-llvm-translator/package.nix
···
rev = "v${version}";
hash = "sha256-rt3RTZut41uDEh0YmpOzH3sOezeEVWtAIGMKCHLSJBw=";
};
-
"17" = rec {
-
version = "17.0.15";
-
rev = "v${version}";
-
hash = "sha256-ETpTQYMMApECDfuRY87HrO/PUxZ13x9dBRJ3ychslUI=";
-
};
-
"16" = rec {
-
version = "16.0.15";
-
rev = "v${version}";
-
hash = "sha256-30i73tGl+1KlP92XA0uxdMTydd9EtaQ4SZ0W1kdm1fQ=";
-
};
-
"15" = rec {
-
version = "15.0.15";
-
rev = "v${version}";
-
hash = "sha256-kFVDS+qwoG1AXrZ8LytoiLVbZkTGR9sO+Wrq3VGgWNQ=";
-
};
-
"14" = rec {
-
version = "14.0.14";
-
rev = "v${version}";
-
hash = "sha256-PW+5w93omLYPZXjRtU4BNY2ztZ86pcjgUQZkrktMq+4=";
-
};
};
branch = versions."${llvmMajor}" or (throw "Incompatible LLVM version ${llvmMajor}");
···
inherit (branch) rev hash;
};
-
patches = lib.optionals (llvmMajor == "14") [
-
(fetchpatch {
-
# tries to install llvm-spirv into llvm nix store path
-
url = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/cce9a2f130070d799000cac42fe24789d2b777ab.patch";
-
revert = true;
-
hash = "sha256-GbFacttZRDCgA0jkUoFA4/B3EDn3etweKvM09OwICJ8=";
-
})
-
];
+
# TODO: Remove.
+
patches = [ ];
nativeBuildInputs = [
pkg-config
-32
pkgs/by-name/wa/wavm/package.nix
···
-
{
-
lib,
-
llvmPackages_12,
-
fetchFromGitHub,
-
cmake,
-
}:
-
-
llvmPackages_12.stdenv.mkDerivation (finalAttrs: {
-
pname = "wavm";
-
version = "2022-05-14";
-
-
src = fetchFromGitHub {
-
owner = "WAVM";
-
repo = "WAVM";
-
rev = "nightly/${finalAttrs.version}";
-
hash = "sha256-SHz+oOOkwvVZucJYFSyZc3MnOAy1VatspmZmOAXYAWA=";
-
};
-
-
nativeBuildInputs = [
-
cmake
-
llvmPackages_12.llvm
-
];
-
-
meta = with lib; {
-
description = "WebAssembly Virtual Machine";
-
mainProgram = "wavm";
-
homepage = "https://wavm.github.io";
-
license = licenses.bsd3;
-
maintainers = with maintainers; [ ereslibre ];
-
platforms = platforms.unix;
-
};
-
})
-44
pkgs/development/compilers/cone/default.nix
···
-
{
-
llvmPackages,
-
lib,
-
fetchFromGitHub,
-
cmake,
-
}:
-
-
llvmPackages.stdenv.mkDerivation rec {
-
pname = "cone";
-
version = "unstable-2022-12-12";
-
-
src = fetchFromGitHub {
-
owner = "jondgoodwin";
-
repo = pname;
-
rev = "698bd6afc75777eabbc8ef576d64d683c6a1c5ab";
-
sha256 = "0y2s9xgkci8n72v6gnc1i7shr2y3g2sa8fbr25gpxa9ipiq9khg7";
-
};
-
-
nativeBuildInputs = [ cmake ];
-
-
buildInputs = [
-
llvmPackages.llvm
-
];
-
-
# M68k is an experimental target, so not enabled by default
-
postPatch = ''
-
sed -i CMakeLists.txt \
-
-e '/M68k/d'
-
'';
-
-
installPhase = ''
-
install -Dm755 conec $out/bin/conec
-
install -Dm644 libconestd.a $out/lib/libconestd.a
-
'';
-
-
meta = with lib; {
-
description = "Cone Programming Language";
-
mainProgram = "conec";
-
homepage = "https://cone.jondgoodwin.com";
-
license = licenses.mit;
-
maintainers = with maintainers; [ ];
-
platforms = platforms.all;
-
};
-
}
+4
pkgs/development/compilers/fpc/default.nix
···
lgpl2
];
platforms = platforms.unix;
+
# See:
+
# * <https://gitlab.com/freepascal.org/fpc/source/-/issues/41045>
+
# * <https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/887>
+
broken = stdenv.cc.isClang && stdenv.hostPlatform.isx86_64;
};
}
+2
pkgs/development/compilers/ghc/common-hadrian.nix
···
timeout = 24 * 3600;
platforms = lib.platforms.all;
inherit (bootPkgs.ghc.meta) license;
+
# To be fixed by <https://github.com/NixOS/nixpkgs/pull/440774>.
+
broken = useLLVM;
};
dontStrip = targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm;
+2
pkgs/development/compilers/ghc/common-make-native-bignum.nix
···
timeout = 24 * 3600;
platforms = lib.platforms.all;
inherit (bootPkgs.ghc.meta) license;
+
# To be fixed by <https://github.com/NixOS/nixpkgs/pull/440774>.
+
broken = useLLVM;
};
}
-235
pkgs/development/compilers/llvm/12/clang/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 9e74014134a0..976e6a1757fd 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.13.4)
-
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
-
project(Clang)
-
-
+ include(GNUInstallDirs)
-
+
-
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to")
-
set(CMAKE_CXX_STANDARD_REQUIRED YES)
-
set(CMAKE_CXX_EXTENSIONS NO)
-
@@ -416,7 +418,7 @@ include_directories(BEFORE
-
-
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
install(DIRECTORY include/clang include/clang-c
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
COMPONENT clang-headers
-
FILES_MATCHING
-
PATTERN "*.def"
-
@@ -425,7 +427,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
)
-
-
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
COMPONENT clang-headers
-
FILES_MATCHING
-
PATTERN "CMakeFiles" EXCLUDE
-
@@ -445,7 +447,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
-
add_custom_target(bash-autocomplete DEPENDS utils/bash-autocomplete.sh)
-
install(PROGRAMS utils/bash-autocomplete.sh
-
- DESTINATION share/clang
-
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-
COMPONENT bash-autocomplete)
-
if(NOT LLVM_ENABLE_IDE)
-
add_llvm_install_targets(install-bash-autocomplete
-
diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake
-
index 704278a0e93b..d25c8d325c71 100644
-
--- a/cmake/modules/AddClang.cmake
-
+++ b/cmake/modules/AddClang.cmake
-
@@ -123,9 +123,9 @@ macro(add_clang_library name)
-
install(TARGETS ${lib}
-
COMPONENT ${lib}
-
${export_to_clangtargets}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- RUNTIME DESTINATION bin)
-
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
-
-
if (NOT LLVM_ENABLE_IDE)
-
add_llvm_install_targets(install-${lib}
-
@@ -170,7 +170,7 @@ macro(add_clang_tool name)
-
-
install(TARGETS ${name}
-
${export_to_clangtargets}
-
- RUNTIME DESTINATION bin
-
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-
COMPONENT ${name})
-
-
if(NOT LLVM_ENABLE_IDE)
-
@@ -185,7 +185,7 @@ endmacro()
-
macro(add_clang_symlink name dest)
-
add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE)
-
# Always generate install targets
-
- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE)
-
+ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE)
-
endmacro()
-
-
function(clang_target_link_libraries target type)
-
diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
-
index b2c0ce8dd4a0..19e5443d8c25 100644
-
--- a/lib/Headers/CMakeLists.txt
-
+++ b/lib/Headers/CMakeLists.txt
-
@@ -215,7 +215,7 @@ set_target_properties(clang-resource-headers PROPERTIES
-
FOLDER "Misc"
-
RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
-
-
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-
+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-
-
install(
-
FILES ${files} ${generated_files}
-
diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt
-
index ceef4b08637c..8efad5520ca4 100644
-
--- a/tools/c-index-test/CMakeLists.txt
-
+++ b/tools/c-index-test/CMakeLists.txt
-
@@ -54,7 +54,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH
-
"@executable_path/../../lib")
-
else()
-
- set(INSTALL_DESTINATION bin)
-
+ set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR})
-
endif()
-
-
install(TARGETS c-index-test
-
diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt
-
index 35ecdb11253c..d77d75de0094 100644
-
--- a/tools/clang-format/CMakeLists.txt
-
+++ b/tools/clang-format/CMakeLists.txt
-
@@ -21,20 +21,20 @@ if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE )
-
endif()
-
-
install(PROGRAMS clang-format-bbedit.applescript
-
- DESTINATION share/clang
-
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-
COMPONENT clang-format)
-
install(PROGRAMS clang-format-diff.py
-
- DESTINATION share/clang
-
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-
COMPONENT clang-format)
-
install(PROGRAMS clang-format-sublime.py
-
- DESTINATION share/clang
-
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-
COMPONENT clang-format)
-
install(PROGRAMS clang-format.el
-
- DESTINATION share/clang
-
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-
COMPONENT clang-format)
-
install(PROGRAMS clang-format.py
-
- DESTINATION share/clang
-
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-
COMPONENT clang-format)
-
install(PROGRAMS git-clang-format
-
- DESTINATION bin
-
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
-
COMPONENT clang-format)
-
diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt
-
index cda8e29ec5b1..0134d8ccd70b 100644
-
--- a/tools/clang-rename/CMakeLists.txt
-
+++ b/tools/clang-rename/CMakeLists.txt
-
@@ -19,8 +19,8 @@ clang_target_link_libraries(clang-rename
-
)
-
-
install(PROGRAMS clang-rename.py
-
- DESTINATION share/clang
-
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-
COMPONENT clang-rename)
-
install(PROGRAMS clang-rename.el
-
- DESTINATION share/clang
-
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-
COMPONENT clang-rename)
-
diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
-
index 51ff2e7e1565..1ed5f8a079a1 100644
-
--- a/tools/libclang/CMakeLists.txt
-
+++ b/tools/libclang/CMakeLists.txt
-
@@ -166,7 +166,7 @@ endif()
-
if(INTERNAL_INSTALL_PREFIX)
-
set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include")
-
else()
-
- set(LIBCLANG_HEADERS_INSTALL_DESTINATION include)
-
+ set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-
endif()
-
-
install(DIRECTORY ../../include/clang-c
-
@@ -196,7 +196,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS})
-
COMPONENT
-
libclang-python-bindings
-
DESTINATION
-
- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
-
+ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
-
endforeach()
-
if(NOT LLVM_ENABLE_IDE)
-
add_custom_target(libclang-python-bindings)
-
diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt
-
index ec0702d76f18..d25d982f51da 100644
-
--- a/tools/scan-build/CMakeLists.txt
-
+++ b/tools/scan-build/CMakeLists.txt
-
@@ -47,7 +47,7 @@ if(CLANG_INSTALL_SCANBUILD)
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
-
install(PROGRAMS bin/${BinFile}
-
- DESTINATION bin
-
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
-
COMPONENT scan-build)
-
endforeach()
-
-
@@ -61,7 +61,7 @@ if(CLANG_INSTALL_SCANBUILD)
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile})
-
install(PROGRAMS libexec/${LibexecFile}
-
- DESTINATION libexec
-
+ DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}
-
COMPONENT scan-build)
-
endforeach()
-
-
@@ -89,7 +89,7 @@ if(CLANG_INSTALL_SCANBUILD)
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile})
-
install(FILES share/scan-build/${ShareFile}
-
- DESTINATION share/scan-build
-
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build
-
COMPONENT scan-build)
-
endforeach()
-
-
diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt
-
index dd3d33439299..fea19c12ce70 100644
-
--- a/tools/scan-view/CMakeLists.txt
-
+++ b/tools/scan-view/CMakeLists.txt
-
@@ -19,7 +19,7 @@ if(CLANG_INSTALL_SCANVIEW)
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
-
install(PROGRAMS bin/${BinFile}
-
- DESTINATION bin
-
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
-
COMPONENT scan-view)
-
endforeach()
-
-
@@ -33,7 +33,7 @@ if(CLANG_INSTALL_SCANVIEW)
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile})
-
install(FILES share/${ShareFile}
-
- DESTINATION share/scan-view
-
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view
-
COMPONENT scan-view)
-
endforeach()
-
-
diff --git a/utils/hmaptool/CMakeLists.txt b/utils/hmaptool/CMakeLists.txt
-
index 62f2de0cb15c..6aa66825b6ec 100644
-
--- a/utils/hmaptool/CMakeLists.txt
-
+++ b/utils/hmaptool/CMakeLists.txt
-
@@ -10,7 +10,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HM
-
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL})
-
install(PROGRAMS ${CLANG_HMAPTOOL}
-
- DESTINATION bin
-
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
-
COMPONENT hmaptool)
-
-
add_custom_target(hmaptool ALL DEPENDS ${Depends})
-28
pkgs/development/compilers/llvm/12/clang/purity.patch
···
-
From 4add81bba40dcec62c4ea4481be8e35ac53e89d8 Mon Sep 17 00:00:00 2001
-
From: Will Dietz <w@wdtz.org>
-
Date: Thu, 18 May 2017 11:56:12 -0500
-
Subject: [PATCH] "purity" patch for 5.0
-
-
---
-
lib/Driver/ToolChains/Gnu.cpp | 7 -------
-
1 file changed, 7 deletions(-)
-
-
diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
-
index fe3c0191bb..c6a482bece 100644
-
--- a/lib/Driver/ToolChains/Gnu.cpp
-
+++ b/lib/Driver/ToolChains/Gnu.cpp
-
@@ -487,12 +487,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
-
if (!IsStatic) {
-
if (Args.hasArg(options::OPT_rdynamic))
-
CmdArgs.push_back("-export-dynamic");
-
-
-
- if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE) {
-
- CmdArgs.push_back("-dynamic-linker");
-
- CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) +
-
- ToolChain.getDynamicLinker(Args)));
-
- }
-
}
-
-
CmdArgs.push_back("-o");
-
--
-
2.11.0
-21
pkgs/development/compilers/llvm/12/compiler-rt/X86-support-extension.patch
···
-
diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt
-
index 3a66dd9c3fb..7efc85d9f9f 100644
-
--- a/lib/builtins/CMakeLists.txt
-
+++ b/lib/builtins/CMakeLists.txt
-
@@ -345,4 +345,8 @@ if (NOT MSVC)
-
-
+ set(i486_SOURCES ${i386_SOURCES})
-
+ set(i586_SOURCES ${i386_SOURCES})
-
+ set(i686_SOURCES ${i386_SOURCES})
-
+
-
if (WIN32)
-
set(i386_SOURCES
-
${i386_SOURCES}
-
@@ -608,6 +612,7 @@ else ()
-
endif()
-
-
foreach (arch ${BUILTIN_SUPPORTED_ARCH})
-
+ message("arch: ${arch}")
-
if (CAN_TARGET_${arch})
-
# For ARM archs, exclude any VFP builtins if VFP is not supported
-
if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$")
-32
pkgs/development/compilers/llvm/12/compiler-rt/armv7l.patch
···
-
diff -ur compiler-rt-10.0.0.src/cmake/builtin-config-ix.cmake compiler-rt-10.0.0.src-patched/cmake/builtin-config-ix.cmake
-
--- compiler-rt-10.0.0.src/cmake/builtin-config-ix.cmake 2020-03-24 00:01:02.000000000 +0900
-
+++ compiler-rt-10.0.0.src-patched/cmake/builtin-config-ix.cmake 2020-05-10 03:42:00.883450706 +0900
-
@@ -24,7 +24,7 @@
-
-
-
set(ARM64 aarch64)
-
-set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k)
-
+set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l)
-
set(HEXAGON hexagon)
-
set(X86 i386)
-
set(X86_64 x86_64)
-
diff -ur compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt compiler-rt-10.0.0.src-patched/lib/builtins/CMakeLists.txt
-
--- compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt 2020-03-24 00:01:02.000000000 +0900
-
+++ compiler-rt-10.0.0.src-patched/lib/builtins/CMakeLists.txt 2020-05-10 03:44:49.468579650 +0900
-
@@ -474,6 +474,7 @@
-
set(armv7_SOURCES ${arm_SOURCES})
-
set(armv7s_SOURCES ${arm_SOURCES})
-
set(armv7k_SOURCES ${arm_SOURCES})
-
+set(armv7l_SOURCES ${arm_SOURCES})
-
set(arm64_SOURCES ${aarch64_SOURCES})
-
-
# macho_embedded archs
-
@@ -595,7 +596,7 @@
-
foreach (arch ${BUILTIN_SUPPORTED_ARCH})
-
if (CAN_TARGET_${arch})
-
# For ARM archs, exclude any VFP builtins if VFP is not supported
-
- if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$")
-
+ if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$")
-
string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}")
-
check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP)
-
if(NOT COMPILER_RT_HAS_${arch}_VFP)
-33
pkgs/development/compilers/llvm/12/compiler-rt/codesign.patch
···
-
From 3dec5f3475a26aeb4678627795c4b67c6b7b4785 Mon Sep 17 00:00:00 2001
-
From: Will Dietz <w@wdtz.org>
-
Date: Tue, 19 Sep 2017 13:13:06 -0500
-
Subject: [PATCH] remove codesign use on Apple, disable ios sim testing that
-
needs it
-
-
---
-
cmake/Modules/AddCompilerRT.cmake | 8 ------
-
test/asan/CMakeLists.txt | 52 ---------------------------------------
-
test/tsan/CMakeLists.txt | 47 -----------------------------------
-
3 files changed, 107 deletions(-)
-
-
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
-
index bc5fb9ff7..b64eb4246 100644
-
--- a/cmake/Modules/AddCompilerRT.cmake
-
+++ b/cmake/Modules/AddCompilerRT.cmake
-
@@ -210,14 +210,6 @@ function(add_compiler_rt_runtime name type)
-
set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "")
-
set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib")
-
endif()
-
- if(APPLE)
-
- # Ad-hoc sign the dylibs
-
- add_custom_command(TARGET ${libname}
-
- POST_BUILD
-
- COMMAND codesign --sign - $<TARGET_FILE:${libname}>
-
- WORKING_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}
-
- )
-
- endif()
-
endif()
-
install(TARGETS ${libname}
-
ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}
-
2.14.1
-
-129
pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index b44ad2c2118e..d42f5664d448 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 3.13.4)
-
# Check if compiler-rt is built as a standalone project.
-
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD)
-
project(CompilerRT C CXX ASM)
-
+ include(GNUInstallDirs)
-
set(COMPILER_RT_STANDALONE_BUILD TRUE)
-
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-
endif()
-
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
-
index 361538a58e47..f0d8d9ab80f1 100644
-
--- a/cmake/Modules/AddCompilerRT.cmake
-
+++ b/cmake/Modules/AddCompilerRT.cmake
-
@@ -495,7 +495,7 @@ macro(add_compiler_rt_resource_file target_name file_name component)
-
add_custom_target(${target_name} DEPENDS ${dst_file})
-
# Install in Clang resource directory.
-
install(FILES ${file_name}
-
- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share
-
+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR}
-
COMPONENT ${component})
-
add_dependencies(${component} ${target_name})
-
-
@@ -512,7 +512,7 @@ macro(add_compiler_rt_script name)
-
add_custom_target(${name} DEPENDS ${dst})
-
install(FILES ${dst}
-
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
-
- DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin)
-
+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR})
-
endmacro(add_compiler_rt_script src name)
-
-
# Builds custom version of libc++ and installs it in <prefix>.
-
diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake
-
index 456a8dcda59f..7a09e74c7c79 100644
-
--- a/cmake/Modules/CompilerRTDarwinUtils.cmake
-
+++ b/cmake/Modules/CompilerRTDarwinUtils.cmake
-
@@ -508,7 +508,7 @@ macro(darwin_add_embedded_builtin_libraries)
-
set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR
-
${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded)
-
set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR
-
- ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded)
-
+ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded)
-
-
set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi")
-
set(CFLAGS_i386 "-march=pentium")
-
diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake
-
index f61d487e93a0..f1f46fb9599c 100644
-
--- a/cmake/Modules/CompilerRTUtils.cmake
-
+++ b/cmake/Modules/CompilerRTUtils.cmake
-
@@ -378,7 +378,7 @@ endfunction()
-
function(get_compiler_rt_install_dir arch install_dir)
-
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-
get_compiler_rt_target(${arch} target)
-
- set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/lib/${target} PARENT_SCOPE)
-
+ set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${target} PARENT_SCOPE)
-
else()
-
set(${install_dir} ${COMPILER_RT_LIBRARY_INSTALL_DIR} PARENT_SCOPE)
-
endif()
-
diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
-
index 1edab43e7c0d..1aac6b73ff82 100644
-
--- a/cmake/base-config-ix.cmake
-
+++ b/cmake/base-config-ix.cmake
-
@@ -65,11 +65,11 @@ if (LLVM_TREE_AVAILABLE)
-
else()
-
# Take output dir and install path from the user.
-
set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH
-
- "Path where built compiler-rt libraries should be stored.")
-
+ "Path where built compiler-rt build artifacts should be stored.")
-
set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH
-
"Path where built compiler-rt executables should be stored.")
-
- set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH
-
- "Path where built compiler-rt libraries should be installed.")
-
+ set(COMPILER_RT_INSTALL_PATH "" CACHE PATH
-
+ "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.")
-
option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF)
-
option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF)
-
# Use a host compiler to compile/link tests.
-
@@ -97,7 +97,7 @@ else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
-
set(COMPILER_RT_LIBRARY_OUTPUT_DIR
-
${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR})
-
set(COMPILER_RT_LIBRARY_INSTALL_DIR
-
- ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR})
-
+ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR})
-
endif()
-
-
if(APPLE)
-
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
-
index b00e8caa1ddd..0fe64e4862c9 100644
-
--- a/include/CMakeLists.txt
-
+++ b/include/CMakeLists.txt
-
@@ -69,22 +69,22 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc")
-
install(FILES ${SANITIZER_HEADERS}
-
COMPONENT compiler-rt-headers
-
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-
- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer)
-
+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer)
-
# Install fuzzer headers.
-
install(FILES ${FUZZER_HEADERS}
-
COMPONENT compiler-rt-headers
-
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-
- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/fuzzer)
-
+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/fuzzer)
-
# Install xray headers.
-
install(FILES ${XRAY_HEADERS}
-
COMPONENT compiler-rt-headers
-
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-
- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray)
-
+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray)
-
# Install profile headers.
-
install(FILES ${PROFILE_HEADERS}
-
COMPONENT compiler-rt-headers
-
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-
- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/profile)
-
+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/profile)
-
-
if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs.
-
add_custom_target(install-compiler-rt-headers
-
diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt
-
index a29de8deff1b..d39ff01613d2 100644
-
--- a/lib/dfsan/CMakeLists.txt
-
+++ b/lib/dfsan/CMakeLists.txt
-
@@ -57,4 +57,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename}
-
DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt)
-
add_dependencies(dfsan dfsan_abilist)
-
install(FILES ${dfsan_abilist_filename}
-
- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share)
-
+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR})
-16
pkgs/development/compilers/llvm/12/compiler-rt/normalize-var.patch
···
-
diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
-
index f1f46fb9599c..6f19e69507ba 100644
-
--- a/cmake/Modules/CompilerRTUtils.cmake
-
+++ b/cmake/Modules/CompilerRTUtils.cmake
-
@@ -302,8 +302,9 @@ macro(load_llvm_config)
-
# Get some LLVM variables from LLVMConfig.
-
include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
-
-
- set(LLVM_LIBRARY_OUTPUT_INTDIR
-
- ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
-
+ get_filename_component(LLVM_LIBRARY_OUTPUT_INTDIR
-
+ ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}
-
+ REALPATH)
-
endif()
-
endmacro()
-
-34
pkgs/development/compilers/llvm/12/libunwind/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 48cb8e004e08..fec8144fb95a 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -23,6 +23,8 @@ set(LIBUNWIND_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx" CACHE PATH
-
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBUNWIND_STANDALONE_BUILD)
-
project(libunwind LANGUAGES C CXX ASM)
-
-
+ include(GNUInstallDirs)
-
+
-
set(PACKAGE_NAME libunwind)
-
set(PACKAGE_VERSION 12.0.0)
-
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
-
@@ -115,17 +117,17 @@ set(CMAKE_MODULE_PATH
-
-
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-
set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++)
-
- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++)
-
+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++)
-
if(LIBCXX_LIBDIR_SUBDIR)
-
string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR})
-
string(APPEND LIBUNWIND_INSTALL_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR})
-
endif()
-
elseif(LLVM_LIBRARY_OUTPUT_INTDIR)
-
set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
-
- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX})
-
+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX})
-
else()
-
set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX})
-
- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX})
-
+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX})
-
endif()
-
-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBUNWIND_LIBRARY_DIR})
-68
pkgs/development/compilers/llvm/12/lld/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index d4e561b50d8f..cfa5bdd79c2a 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
-
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(LLD_BUILT_STANDALONE TRUE)
-
-
+ include(GNUInstallDirs)
-
+
-
find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary")
-
if(NOT LLVM_CONFIG_PATH)
-
message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH")
-
@@ -179,7 +181,7 @@ include_directories(BEFORE
-
-
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
install(DIRECTORY include/
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
FILES_MATCHING
-
PATTERN "*.h"
-
)
-
diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake
-
index 23df41312403..d62372c88de7 100644
-
--- a/cmake/modules/AddLLD.cmake
-
+++ b/cmake/modules/AddLLD.cmake
-
@@ -20,9 +20,9 @@ macro(add_lld_library name)
-
install(TARGETS ${name}
-
COMPONENT ${name}
-
${export_to_lldtargets}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- RUNTIME DESTINATION bin)
-
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
-
-
if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
-
add_llvm_install_targets(install-${name}
-
@@ -54,7 +54,7 @@ macro(add_lld_tool name)
-
-
install(TARGETS ${name}
-
${export_to_lldtargets}
-
- RUNTIME DESTINATION bin
-
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-
COMPONENT ${name})
-
-
if(NOT CMAKE_CONFIGURATION_TYPES)
-
@@ -69,5 +69,5 @@ endmacro()
-
macro(add_lld_symlink name dest)
-
add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE)
-
# Always generate install targets
-
- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE)
-
+ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE)
-
endmacro()
-
diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt
-
index 5cff736ff57f..64e775c771b9 100644
-
--- a/tools/lld/CMakeLists.txt
-
+++ b/tools/lld/CMakeLists.txt
-
@@ -21,7 +21,7 @@ target_link_libraries(lld
-
)
-
-
install(TARGETS lld
-
- RUNTIME DESTINATION bin)
-
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
-
-
if(NOT LLD_SYMLINKS_TO_CREATE)
-
set(LLD_SYMLINKS_TO_CREATE
-110
pkgs/development/compilers/llvm/12/lldb/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index b5633e21c56a..f2f1035e9238 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -10,6 +10,8 @@ set(CMAKE_MODULE_PATH
-
# If we are not building as part of LLVM, build LLDB as a standalone project,
-
# using LLVM as an external library.
-
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
-
+ include(GNUInstallDirs)
-
+
-
project(lldb)
-
include(LLDBStandalone)
-
-
diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake
-
index 4ed5c647c5d2..89f96e710d55 100644
-
--- a/cmake/modules/AddLLDB.cmake
-
+++ b/cmake/modules/AddLLDB.cmake
-
@@ -107,13 +107,13 @@ function(add_lldb_library name)
-
endif()
-
-
if(PARAM_SHARED)
-
- set(install_dest lib${LLVM_LIBDIR_SUFFIX})
-
+ set(install_dest ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
if(PARAM_INSTALL_PREFIX)
-
set(install_dest ${PARAM_INSTALL_PREFIX})
-
endif()
-
# RUNTIME is relevant for DLL platforms, FRAMEWORK for macOS
-
install(TARGETS ${name} COMPONENT ${name}
-
- RUNTIME DESTINATION bin
-
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-
LIBRARY DESTINATION ${install_dest}
-
ARCHIVE DESTINATION ${install_dest}
-
FRAMEWORK DESTINATION ${install_dest})
-
diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake
-
index 2fdf1502d055..37364341ff8b 100644
-
--- a/cmake/modules/LLDBConfig.cmake
-
+++ b/cmake/modules/LLDBConfig.cmake
-
@@ -225,7 +225,7 @@ include_directories(BEFORE
-
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
install(DIRECTORY include/
-
COMPONENT lldb-headers
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
FILES_MATCHING
-
PATTERN "*.h"
-
PATTERN ".cmake" EXCLUDE
-
@@ -233,7 +233,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
-
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
-
COMPONENT lldb-headers
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
FILES_MATCHING
-
PATTERN "*.h"
-
PATTERN ".cmake" EXCLUDE
-
diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt
-
index 734167e51bc5..f95761b5df58 100644
-
--- a/tools/intel-features/CMakeLists.txt
-
+++ b/tools/intel-features/CMakeLists.txt
-
@@ -65,4 +65,4 @@ if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
-
endif()
-
-
install(TARGETS lldbIntelFeatures
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
diff --git a/cmake/modules/LLDBStandalone.cmake b/cmake/modules/LLDBStandalone.cmake
-
index 752113b..010f187 100644
-
--- a/cmake/modules/LLDBStandalone.cmake
-
+++ b/cmake/modules/LLDBStandalone.cmake
-
@@ -62,7 +62,7 @@ endif()
-
-
# They are used as destination of target generators.
-
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
-
-set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
-
+set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
if(WIN32 OR CYGWIN)
-
# DLL platform -- put DLLs into bin.
-
set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index b5633e2..86e4738 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -79,7 +79,7 @@ if (LLDB_ENABLE_PYTHON)
-
if(LLDB_BUILD_FRAMEWORK)
-
set(lldb_python_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb")
-
else()
-
- set(lldb_python_target_dir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb")
-
+ set(lldb_python_target_dir "${CMAKE_INSTALL_LIBDIR}/../${LLDB_PYTHON_RELATIVE_PATH}/lldb")
-
endif()
-
get_target_property(lldb_python_bindings_dir swig_wrapper_python BINARY_DIR)
-
finish_swig_python("lldb-python" "${lldb_python_bindings_dir}" "${lldb_python_target_dir}")
-
diff --git a/source/API/CMakeLists.txt b/source/API/CMakeLists.txt
-
index b5633e2..86e4738 100644
-
--- a/source/API/CMakeLists.txt 2024-05-30 19:08:14.241656491 -0700
-
+++ b/source/API/CMakeLists.txt 2024-05-30 19:08:48.218219667 -0700
-
@@ -113,14 +113,6 @@
-
${option_install_prefix}
-
)
-
-
-# lib/pythonX.Y/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so,
-
-# which depends on lib/libLLVM*.so (BUILD_SHARED_LIBS) or lib/libLLVM-10git.so
-
-# (LLVM_LINK_LLVM_DYLIB). Add an additional rpath $ORIGIN/../../../../lib so
-
-# that _lldb.so can be loaded from Python.
-
-if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) AND UNIX AND NOT APPLE)
-
- set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}")
-
-endif()
-
-
-
if(Python3_RPATH)
-
set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "${Python3_RPATH}")
-
set_property(TARGET liblldb APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}")
-31
pkgs/development/compilers/llvm/12/lldb/procfs.patch
···
-
--- a/source/Plugins/Process/Linux/Procfs.h
-
+++ b/source/Plugins/Process/Linux/Procfs.h
-
@@ -11,21 +11,12 @@
-
// sys/procfs.h on Android/Linux for all supported architectures.
-
-
#include <sys/ptrace.h>
-
+#include <asm/ptrace.h>
-
-
-#ifdef __ANDROID__
-
-#if defined(__arm64__) || defined(__aarch64__)
-
-typedef unsigned long elf_greg_t;
-
-typedef elf_greg_t
-
- elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
-
-typedef struct user_fpsimd_state elf_fpregset_t;
-
-#ifndef NT_FPREGSET
-
-#define NT_FPREGSET NT_PRFPREG
-
-#endif // NT_FPREGSET
-
-#elif defined(__mips__)
-
-#ifndef NT_FPREGSET
-
-#define NT_FPREGSET NT_PRFPREG
-
-#endif // NT_FPREGSET
-
-#endif
-
-#else // __ANDROID__
-
+#if !defined(__GLIBC__) && defined(__powerpc__)
-
+#define pt_regs musl_pt_regs
-
+#include <sys/procfs.h>
-
+#undef pt_regs
-
+#else
-
#include <sys/procfs.h>
-
-#endif // __ANDROID__
-
+#endif
-13
pkgs/development/compilers/llvm/12/lldb/resource-dir.patch
···
-
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
-
index 37364341ff8b..7f74c1a3e257 100644
-
--- a/cmake/modules/LLDBConfig.cmake
-
+++ b/cmake/modules/LLDBConfig.cmake
-
@@ -257,7 +257,7 @@ if (NOT TARGET clang-resource-headers)
-
# Iterate over the possible places where the external resource directory
-
# could be and pick the first that exists.
-
foreach(CANDIDATE "${Clang_DIR}/../.." "${LLVM_DIR}" "${LLVM_LIBRARY_DIRS}"
-
- "${LLVM_BUILD_LIBRARY_DIR}"
-
+ "${LLVM_BUILD_LIBRARY_DIR}" "@clangLibDir@"
-
"${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}")
-
# Build the resource directory path by appending 'clang/<version number>'.
-
set(CANDIDATE_RESOURCE_DIR "${CANDIDATE}/clang/${LLDB_CLANG_RESOURCE_DIR_NAME}")
-13
pkgs/development/compilers/llvm/12/llvm/fix-llvm-issue-49955.patch
···
-
diff --git a/lib/CodeGen/AsmPrinter/CMakeLists.txt b/lib/CodeGen/AsmPrinter/CMakeLists.txt
-
index eb924282..c77c140b 100644
-
--- a/lib/CodeGen/AsmPrinter/CMakeLists.txt
-
+++ b/lib/CodeGen/AsmPrinter/CMakeLists.txt
-
@@ -44,3 +44,8 @@ add_llvm_component_library(LLVMAsmPrinter
-
Support
-
Target
-
)
-
+
-
+if (CMAKE_COMPILER_IS_GNUCXX)
-
+ set_source_files_properties(DwarfCompileUnit.cpp PROPERTIES
-
+ COMPILE_FLAGS -fno-strict-aliasing)
-
+endif()
-105
pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs-polly.patch
···
-
diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt
-
index ca7c04c565bb..6ed5db5dd4f8 100644
-
--- a/tools/polly/CMakeLists.txt
-
+++ b/tools/polly/CMakeLists.txt
-
@@ -2,7 +2,11 @@
-
if (NOT DEFINED LLVM_MAIN_SRC_DIR)
-
project(Polly)
-
cmake_minimum_required(VERSION 3.13.4)
-
+endif()
-
+
-
+include(GNUInstallDirs)
-
-
+if (NOT DEFINED LLVM_MAIN_SRC_DIR)
-
# Where is LLVM installed?
-
find_package(LLVM CONFIG REQUIRED)
-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR})
-
@@ -122,13 +126,13 @@ include_directories(
-
-
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
install(DIRECTORY include/
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
FILES_MATCHING
-
PATTERN "*.h"
-
)
-
-
install(DIRECTORY ${POLLY_BINARY_DIR}/include/
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
FILES_MATCHING
-
PATTERN "*.h"
-
PATTERN "CMakeFiles" EXCLUDE
-
diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt
-
index 7cc129ba2e90..137be25e4b80 100644
-
--- a/tools/polly/cmake/CMakeLists.txt
-
+++ b/tools/polly/cmake/CMakeLists.txt
-
@@ -79,18 +79,18 @@ file(GENERATE
-
-
# Generate PollyConfig.cmake for the install tree.
-
unset(POLLY_EXPORTS)
-
-set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
+set(POLLY_INSTALL_PREFIX "")
-
set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
-
-set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}")
-
-set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}")
-
+set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}")
-
+set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
if (POLLY_BUNDLED_ISL)
-
set(POLLY_CONFIG_INCLUDE_DIRS
-
- "${POLLY_INSTALL_PREFIX}/include"
-
- "${POLLY_INSTALL_PREFIX}/include/polly"
-
+ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}"
-
+ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly"
-
)
-
else()
-
set(POLLY_CONFIG_INCLUDE_DIRS
-
- "${POLLY_INSTALL_PREFIX}/include"
-
+ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}"
-
${ISL_INCLUDE_DIRS}
-
)
-
endif()
-
@@ -100,12 +100,12 @@ endif()
-
foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS)
-
get_target_property(tgt_type ${tgt} TYPE)
-
if (tgt_type STREQUAL "EXECUTABLE")
-
- set(tgt_prefix "bin/")
-
+ set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/")
-
else()
-
- set(tgt_prefix "lib/")
-
+ set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/")
-
endif()
-
-
- set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$<TARGET_FILE_NAME:${tgt}>")
-
+ set(tgt_path "${tgt_prefix}$<TARGET_FILE_NAME:${tgt}>")
-
file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path})
-
-
if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY")
-
diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake
-
index 518a09b45a42..bd9d6f5542ad 100644
-
--- a/tools/polly/cmake/polly_macros.cmake
-
+++ b/tools/polly/cmake/polly_macros.cmake
-
@@ -44,8 +44,8 @@ macro(add_polly_library name)
-
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly")
-
install(TARGETS ${name}
-
EXPORT LLVMExports
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
endif()
-
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
-
endmacro(add_polly_library)
-
diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt
-
index 8991094d92c7..178d8ad606bb 100644
-
--- a/tools/polly/lib/External/CMakeLists.txt
-
+++ b/tools/polly/lib/External/CMakeLists.txt
-
@@ -275,7 +275,7 @@ if (POLLY_BUNDLED_ISL)
-
install(DIRECTORY
-
${ISL_SOURCE_DIR}/include/
-
${ISL_BINARY_DIR}/include/
-
- DESTINATION include/polly
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly
-
FILES_MATCHING
-
PATTERN "*.h"
-
PATTERN "CMakeFiles" EXCLUDE
-417
pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 277d0fe54d7b..af69c8be8745 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -256,15 +256,21 @@ if (CMAKE_BUILD_TYPE AND
-
message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
-
endif()
-
-
+include(GNUInstallDirs)
-
+
-
set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
-
-
-set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
-
+set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING
-
+ "Path for binary subdirectory (defaults to 'bin')")
-
mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
-
-
set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING
-
"Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)")
-
mark_as_advanced(LLVM_UTILS_INSTALL_DIR)
-
-
+set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING
-
+ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" )
-
+
-
# They are used as destination of target generators.
-
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
-
set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
-
@@ -567,9 +573,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
-
option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON)
-
option (LLVM_ENABLE_BINDINGS "Build bindings." ON)
-
-
-set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html"
-
+set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html"
-
CACHE STRING "Doxygen-generated HTML documentation install directory")
-
-set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html"
-
+set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html"
-
CACHE STRING "OCamldoc-generated HTML documentation install directory")
-
-
option (LLVM_BUILD_EXTERNAL_COMPILER_RT
-
@@ -1027,7 +1033,7 @@ endif()
-
-
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
install(DIRECTORY include/llvm include/llvm-c
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
COMPONENT llvm-headers
-
FILES_MATCHING
-
PATTERN "*.def"
-
@@ -1038,7 +1044,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
)
-
-
install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
COMPONENT llvm-headers
-
FILES_MATCHING
-
PATTERN "*.def"
-
@@ -1052,13 +1058,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
-
if (LLVM_INSTALL_MODULEMAPS)
-
install(DIRECTORY include/llvm include/llvm-c
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
COMPONENT llvm-headers
-
FILES_MATCHING
-
PATTERN "module.modulemap"
-
)
-
install(FILES include/llvm/module.install.modulemap
-
- DESTINATION include/llvm
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm
-
COMPONENT llvm-headers
-
RENAME "module.extern.modulemap"
-
)
-
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
-
index 97c9980c7de3..409e8b615f75 100644
-
--- a/cmake/modules/AddLLVM.cmake
-
+++ b/cmake/modules/AddLLVM.cmake
-
@@ -804,9 +804,9 @@ macro(add_llvm_library name)
-
-
install(TARGETS ${name}
-
${export_to_llvmexports}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
- RUNTIME DESTINATION bin COMPONENT ${name})
-
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${name})
-
-
if (NOT LLVM_ENABLE_IDE)
-
add_llvm_install_targets(install-${name}
-
@@ -1022,7 +1022,7 @@ function(process_llvm_pass_plugins)
-
"set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})")
-
install(FILES
-
${llvm_cmake_builddir}/LLVMConfigExtensions.cmake
-
- DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
-
+ DESTINATION ${LLVM_INSTALL_CMAKE_DIR}
-
COMPONENT cmake-exports)
-
-
set(ExtensionDef "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def")
-
@@ -1242,7 +1242,7 @@ macro(add_llvm_example name)
-
endif()
-
add_llvm_executable(${name} ${ARGN})
-
if( LLVM_BUILD_EXAMPLES )
-
- install(TARGETS ${name} RUNTIME DESTINATION examples)
-
+ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
-
endif()
-
set_target_properties(${name} PROPERTIES FOLDER "Examples")
-
endmacro(add_llvm_example name)
-
@@ -1854,7 +1854,7 @@ function(llvm_install_library_symlink name dest type)
-
set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX})
-
set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX})
-
-
- set(output_dir lib${LLVM_LIBDIR_SUFFIX})
-
+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
if(WIN32 AND "${type}" STREQUAL "SHARED")
-
set(output_dir bin)
-
endif()
-
@@ -1871,7 +1871,7 @@ function(llvm_install_library_symlink name dest type)
-
endif()
-
endfunction()
-
-
-function(llvm_install_symlink name dest)
-
+function(llvm_install_symlink name dest output_dir)
-
cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN})
-
foreach(path ${CMAKE_MODULE_PATH})
-
if(EXISTS ${path}/LLVMInstallSymlink.cmake)
-
@@ -1894,7 +1894,7 @@ function(llvm_install_symlink name dest)
-
set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX})
-
-
install(SCRIPT ${INSTALL_SYMLINK}
-
- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})"
-
+ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})"
-
COMPONENT ${component})
-
-
if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE)
-
@@ -1977,7 +1977,8 @@ function(add_llvm_tool_symlink link_name target)
-
endif()
-
-
if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS)
-
- llvm_install_symlink(${link_name} ${target})
-
+ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR)
-
+ llvm_install_symlink(${link_name} ${target} ${output_dir})
-
endif()
-
endif()
-
endfunction()
-
@@ -2100,9 +2101,9 @@ function(llvm_setup_rpath name)
-
-
if (APPLE)
-
set(_install_name_dir INSTALL_NAME_DIR "@rpath")
-
- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
elseif(UNIX)
-
- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
-
set_property(TARGET ${name} APPEND_STRING PROPERTY
-
LINK_FLAGS " -Wl,-z,origin ")
-
diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
-
index 554046b20edf..4d1ad980641e 100644
-
--- a/cmake/modules/AddOCaml.cmake
-
+++ b/cmake/modules/AddOCaml.cmake
-
@@ -144,9 +144,9 @@ function(add_ocaml_library name)
-
endforeach()
-
-
if( APPLE )
-
- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
elseif( UNIX )
-
- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
endif()
-
list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}")
-
-
diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake
-
index e80c3b5c1cac..482f6d715ef5 100644
-
--- a/cmake/modules/AddSphinxTarget.cmake
-
+++ b/cmake/modules/AddSphinxTarget.cmake
-
@@ -90,7 +90,7 @@ function (add_sphinx_target builder project)
-
endif()
-
elseif (builder STREQUAL html)
-
string(TOUPPER "${project}" project_upper)
-
- set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html"
-
+ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html"
-
CACHE STRING "HTML documentation install directory for ${project}")
-
-
# '/.' indicates: copy the contents of the directory directly into
-
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
-
index 505dc9a29d70..36e6c63af3f4 100644
-
--- a/cmake/modules/CMakeLists.txt
-
+++ b/cmake/modules/CMakeLists.txt
-
@@ -1,4 +1,4 @@
-
-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
-
+set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')")
-
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
-
-
# First for users who use an installed LLVM, create the LLVMExports.cmake file.
-
@@ -107,13 +107,13 @@ foreach(p ${_count})
-
set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE}
-
get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)")
-
endforeach(p)
-
-set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include")
-
+set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
-
set(LLVM_CONFIG_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}")
-
set(LLVM_CONFIG_MAIN_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}")
-
-set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}")
-
+set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}")
-
set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}")
-
set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}")
-
-set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin")
-
+set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
-
-
# Generate a default location for lit
-
if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)
-
diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake
-
index 09fed8085c23..aa79f192abf0 100644
-
--- a/cmake/modules/LLVMInstallSymlink.cmake
-
+++ b/cmake/modules/LLVMInstallSymlink.cmake
-
@@ -10,7 +10,7 @@ function(install_symlink name target outdir)
-
set(LINK_OR_COPY copy)
-
endif()
-
-
- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
-
+ set(bindir "${DESTDIR}${outdir}/")
-
-
message(STATUS "Creating ${name}")
-
-
diff --git a/docs/CMake.rst b/docs/CMake.rst
-
index bb821b417ad9..6a528f7c2ad3 100644
-
--- a/docs/CMake.rst
-
+++ b/docs/CMake.rst
-
@@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``.
-
**LLVM_LIBDIR_SUFFIX**:STRING
-
Extra suffix to append to the directory where libraries are to be
-
installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
-
- to install libraries to ``/usr/lib64``.
-
+ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``.
-
-
**CMAKE_C_FLAGS**:STRING
-
Extra flags to use when compiling C source files.
-
@@ -550,8 +550,8 @@ LLVM-specific variables
-
-
**LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING
-
The path to install Doxygen-generated HTML documentation to. This path can
-
- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to
-
- `share/doc/llvm/doxygen-html`.
-
+ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to
-
+ `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`.
-
-
**LLVM_ENABLE_SPHINX**:BOOL
-
If specified, CMake will search for the ``sphinx-build`` executable and will make
-
@@ -582,13 +582,33 @@ LLVM-specific variables
-
-
**LLVM_INSTALL_SPHINX_HTML_DIR**:STRING
-
The path to install Sphinx-generated HTML documentation to. This path can
-
- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to
-
- `share/doc/llvm/html`.
-
+ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to
-
+ `${CMAKE_INSTALL_DOCDIR}/${project}/html`.
-
-
**LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING
-
The path to install OCamldoc-generated HTML documentation to. This path can
-
- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to
-
- `share/doc/llvm/ocaml-html`.
-
+ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to
-
+ `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`.
-
+
-
+**CMAKE_INSTALL_BINDIR**:STRING
-
+ The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``.
-
+ Defaults to `bin`.
-
+
-
+**CMAKE_INSTALL_LIBDIR**:STRING
-
+ The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``.
-
+ Defaults to `lib`.
-
+
-
+**CMAKE_INSTALL_INCLUDEDIR**:STRING
-
+ The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``.
-
+ Defaults to `include`.
-
+
-
+**CMAKE_INSTALL_DOCDIR**:STRING
-
+ The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``.
-
+ Defaults to `share/doc`.
-
+
-
+**CMAKE_INSTALL_MANDIR**:STRING
-
+ The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``.
-
+ Defaults to `share/man`.
-
-
**LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL
-
macOS Only: If enabled CMake will generate a target named
-
@@ -786,9 +806,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``).
-
-
This file is available in two different locations.
-
-
-* ``<INSTALL_PREFIX>/lib/cmake/llvm/LLVMConfig.cmake`` where
-
- ``<INSTALL_PREFIX>`` is the install prefix of an installed version of LLVM.
-
- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``.
-
+* ``<LLVM_INSTALL_PACKAGE_DIR>LLVMConfig.cmake`` where
-
+ ``<LLVM_INSTALL_PACKAGE_DIR>`` is the location where LLVM CMake modules are
-
+ installed as part of an installed version of LLVM. This is typically
-
+ ``cmake/llvm/`` within the lib directory. On Linux, this is typically
-
+ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``.
-
-
* ``<LLVM_BUILD_ROOT>/lib/cmake/llvm/LLVMConfig.cmake`` where
-
``<LLVM_BUILD_ROOT>`` is the root of the LLVM build tree. **Note: this is only
-
diff --git a/examples/Bye/CMakeLists.txt b/examples/Bye/CMakeLists.txt
-
index bb96edb4b4bf..678c22fb43c8 100644
-
--- a/examples/Bye/CMakeLists.txt
-
+++ b/examples/Bye/CMakeLists.txt
-
@@ -14,6 +14,6 @@ if (NOT WIN32)
-
BUILDTREE_ONLY
-
)
-
-
- install(TARGETS ${name} RUNTIME DESTINATION examples)
-
+ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
-
set_target_properties(${name} PROPERTIES FOLDER "Examples")
-
endif()
-
diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt
-
index b46319f24fc8..2feabd1954e4 100644
-
--- a/include/llvm/CMakeLists.txt
-
+++ b/include/llvm/CMakeLists.txt
-
@@ -5,5 +5,5 @@ add_subdirectory(Frontend)
-
# If we're doing an out-of-tree build, copy a module map for generated
-
# header files into the build area.
-
if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-
- configure_file(module.modulemap.build module.modulemap COPYONLY)
-
+ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY)
-
endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-
index ebe5b73a5c65..70c497be12f5 100644
-
--- a/tools/llvm-config/BuildVariables.inc.in
-
+++ b/tools/llvm-config/BuildVariables.inc.in
-
@@ -23,6 +23,10 @@
-
#define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
-
#define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
-
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
-
+#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@"
-
+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@"
-
+#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
-
+#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@"
-
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
-
#define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
-
#define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"
-
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-
index 1a2f04552d13..44fa7d3eec6b 100644
-
--- a/tools/llvm-config/llvm-config.cpp
-
+++ b/tools/llvm-config/llvm-config.cpp
-
@@ -357,12 +357,26 @@ int main(int argc, char **argv) {
-
("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
-
} else {
-
ActivePrefix = CurrentExecPrefix;
-
- ActiveIncludeDir = ActivePrefix + "/include";
-
- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
-
- sys::fs::make_absolute(ActivePrefix, path);
-
- ActiveBinDir = std::string(path.str());
-
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
-
- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
-
+ {
-
+ SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR));
-
+ sys::fs::make_absolute(ActivePrefix, path);
-
+ ActiveIncludeDir = std::string(path.str());
-
+ }
-
+ {
-
+ SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR));
-
+ sys::fs::make_absolute(ActivePrefix, path);
-
+ ActiveBinDir = std::string(path.str());
-
+ }
-
+ {
-
+ SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX));
-
+ sys::fs::make_absolute(ActivePrefix, path);
-
+ ActiveLibDir = std::string(path.str());
-
+ }
-
+ {
-
+ SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR));
-
+ sys::fs::make_absolute(ActivePrefix, path);
-
+ ActiveCMakeDir = std::string(path.str());
-
+ }
-
ActiveIncludeOption = "-I" + ActiveIncludeDir;
-
}
-
-
diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt
-
index 2963f97cad88..69d66c9c9ca1 100644
-
--- a/tools/lto/CMakeLists.txt
-
+++ b/tools/lto/CMakeLists.txt
-
@@ -25,7 +25,7 @@ add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS
-
intrinsics_gen)
-
-
install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
-
- DESTINATION include/llvm-c
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c
-
COMPONENT LTO)
-
-
if (APPLE)
-
diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt
-
index ead73ec13a8f..250362021f17 100644
-
--- a/tools/opt-viewer/CMakeLists.txt
-
+++ b/tools/opt-viewer/CMakeLists.txt
-
@@ -8,7 +8,7 @@ set (files
-
-
foreach (file ${files})
-
install(PROGRAMS ${file}
-
- DESTINATION share/opt-viewer
-
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer
-
COMPONENT opt-viewer)
-
endforeach (file)
-
-
diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt
-
index 865436247270..ce1daa62f6ab 100644
-
--- a/tools/remarks-shlib/CMakeLists.txt
-
+++ b/tools/remarks-shlib/CMakeLists.txt
-
@@ -19,7 +19,7 @@ if(LLVM_ENABLE_PIC)
-
endif()
-
-
install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
-
- DESTINATION include/llvm-c
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c
-
COMPONENT Remarks)
-
-
if (APPLE)
-19
pkgs/development/compilers/llvm/12/llvm/no-pipes.patch
···
-
diff --git a/test/Bindings/Go/lit.local.cfg b/test/Bindings/Go/lit.local.cfg
-
index 91a0ad89..4da83a1a 100644
-
--- a/test/Bindings/Go/lit.local.cfg
-
+++ b/test/Bindings/Go/lit.local.cfg
-
@@ -1,5 +1,4 @@
-
import os
-
-import pipes
-
import shlex
-
import sys
-
-
@@ -56,7 +55,7 @@ def fixup_compiler_path(compiler):
-
except (AttributeError, OSError):
-
pass
-
-
- return ' '.join([pipes.quote(arg) for arg in args])
-
+ return ' '.join([shlex.quote(arg) for arg in args])
-
-
config.environment['CC'] = fixup_compiler_path(config.host_cc)
-
config.environment['CXX'] = fixup_compiler_path(config.host_cxx)
-78
pkgs/development/compilers/llvm/13/clang/revert-malloc-alignment-assumption.patch
···
-
--- b/include/clang/Basic/TargetInfo.h
-
+++ a/include/clang/Basic/TargetInfo.h
-
@@ -612,8 +612,8 @@
-
}
-
-
/// Return the largest alignment for which a suitably-sized allocation with
-
+ /// '::operator new(size_t)' is guaranteed to produce a correctly-aligned
-
+ /// pointer.
-
- /// '::operator new(size_t)' or 'malloc' is guaranteed to produce a
-
- /// correctly-aligned pointer.
-
unsigned getNewAlign() const {
-
return NewAlign ? NewAlign : std::max(LongDoubleAlign, LongLongAlign);
-
}
-
--- b/lib/CodeGen/CGCall.cpp
-
+++ a/lib/CodeGen/CGCall.cpp
-
@@ -2048,24 +2048,6 @@
-
// allows it to work on indirect virtual function calls.
-
if (AttrOnCallSite && TargetDecl->hasAttr<NoMergeAttr>())
-
FuncAttrs.addAttribute(llvm::Attribute::NoMerge);
-
-
-
- // Add known guaranteed alignment for allocation functions.
-
- if (unsigned BuiltinID = Fn->getBuiltinID()) {
-
- switch (BuiltinID) {
-
- case Builtin::BIaligned_alloc:
-
- case Builtin::BIcalloc:
-
- case Builtin::BImalloc:
-
- case Builtin::BImemalign:
-
- case Builtin::BIrealloc:
-
- case Builtin::BIstrdup:
-
- case Builtin::BIstrndup:
-
- RetAttrs.addAlignmentAttr(Context.getTargetInfo().getNewAlign() /
-
- Context.getTargetInfo().getCharWidth());
-
- break;
-
- default:
-
- break;
-
- }
-
- }
-
}
-
-
// 'const', 'pure' and 'noalias' attributed functions are also nounwind.
-
--- b/test/CodeGen/alloc-fns-alignment.c
-
+++ /dev/null
-
@@ -1,35 +0,0 @@
-
-// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm < %s | FileCheck %s --check-prefix=ALIGN16
-
-// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm < %s | FileCheck %s --check-prefix=ALIGN16
-
-// RUN: %clang_cc1 -triple i386-apple-darwin -emit-llvm < %s | FileCheck %s --check-prefix=ALIGN16
-
-// RUN: %clang_cc1 -triple i386-unknown-linux-gnu -emit-llvm < %s | FileCheck %s --check-prefix=ALIGN8
-
-// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fno-builtin-malloc -emit-llvm < %s | FileCheck %s --check-prefix=NOBUILTIN-MALLOC
-
-// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fno-builtin-calloc -emit-llvm < %s | FileCheck %s --check-prefix=NOBUILTIN-CALLOC
-
-// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fno-builtin-realloc -emit-llvm < %s | FileCheck %s --check-prefix=NOBUILTIN-REALLOC
-
-
-
-typedef __SIZE_TYPE__ size_t;
-
-
-
-void *malloc(size_t);
-
-void *calloc(size_t, size_t);
-
-void *realloc(void *, size_t);
-
-
-
-void *malloc_test(size_t n) {
-
- return malloc(n);
-
-}
-
-
-
-void *calloc_test(size_t n) {
-
- return calloc(1, n);
-
-}
-
-
-
-void *raalloc_test(void *p, size_t n) {
-
- return realloc(p, n);
-
-}
-
-
-
-// ALIGN16: align 16 i8* @malloc
-
-// ALIGN16: align 16 i8* @calloc
-
-// ALIGN16: align 16 i8* @realloc
-
-// ALIGN8: align 8 i8* @malloc
-
-// ALIGN8: align 8 i8* @calloc
-
-// ALIGN8: align 8 i8* @realloc
-
-// NOBUILTIN-MALLOC: declare i8* @malloc
-
-// NOBUILTIN-CALLOC: declare i8* @calloc
-
-// NOBUILTIN-REALLOC: declare i8* @realloc
-31
pkgs/development/compilers/llvm/13/compiler-rt/armv7l.patch
···
-
diff -ur compiler-rt-10.0.0.src/cmake/builtin-config-ix.cmake compiler-rt-10.0.0.src-patched/cmake/builtin-config-ix.cmake
-
--- compiler-rt-10.0.0.src/cmake/builtin-config-ix.cmake 2020-03-24 00:01:02.000000000 +0900
-
+++ compiler-rt-10.0.0.src-patched/cmake/builtin-config-ix.cmake 2020-05-10 03:42:00.883450706 +0900
-
@@ -37,6 +37,6 @@
-
-
set(ARM64 aarch64)
-
-set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv8m.main armv8.1m.main)
-
+set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l armv8m.main armv8.1m.main)
-
set(HEXAGON hexagon)
-
set(X86 i386)
-
set(X86_64 x86_64)
-
diff -ur compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt compiler-rt-10.0.0.src-patched/lib/builtins/CMakeLists.txt
-
--- compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt 2020-03-24 00:01:02.000000000 +0900
-
+++ compiler-rt-10.0.0.src-patched/lib/builtins/CMakeLists.txt 2020-05-10 03:44:49.468579650 +0900
-
@@ -555,6 +555,7 @@
-
set(armv7_SOURCES ${arm_SOURCES})
-
set(armv7s_SOURCES ${arm_SOURCES})
-
set(armv7k_SOURCES ${arm_SOURCES})
-
+set(armv7l_SOURCES ${arm_SOURCES})
-
set(arm64_SOURCES ${aarch64_SOURCES})
-
-
# macho_embedded archs
-
@@ -705,7 +705,7 @@
-
foreach (arch ${BUILTIN_SUPPORTED_ARCH})
-
if (CAN_TARGET_${arch})
-
# For ARM archs, exclude any VFP builtins if VFP is not supported
-
- if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em|armv8m.main|armv8.1m.main)$")
-
+ if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em|armv8m.main|armv8.1m.main)$")
-
string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}")
-
check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP)
-
if(NOT COMPILER_RT_HAS_${arch}_VFP)
-33
pkgs/development/compilers/llvm/13/compiler-rt/codesign.patch
···
-
From 3dec5f3475a26aeb4678627795c4b67c6b7b4785 Mon Sep 17 00:00:00 2001
-
From: Will Dietz <w@wdtz.org>
-
Date: Tue, 19 Sep 2017 13:13:06 -0500
-
Subject: [PATCH] remove codesign use on Apple, disable ios sim testing that
-
needs it
-
-
---
-
cmake/Modules/AddCompilerRT.cmake | 8 ------
-
test/asan/CMakeLists.txt | 52 ---------------------------------------
-
test/tsan/CMakeLists.txt | 47 -----------------------------------
-
3 files changed, 107 deletions(-)
-
-
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
-
index bc69ec95c419..9f100fdcec2f 100644
-
--- a/cmake/Modules/AddCompilerRT.cmake
-
+++ b/cmake/Modules/AddCompilerRT.cmake
-
@@ -366,14 +366,6 @@ function(add_compiler_rt_runtime name type)
-
set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "")
-
set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib")
-
endif()
-
- if(APPLE)
-
- # Ad-hoc sign the dylibs
-
- add_custom_command(TARGET ${libname}
-
- POST_BUILD
-
- COMMAND codesign --sign - $<TARGET_FILE:${libname}>
-
- WORKING_DIRECTORY ${COMPILER_RT_OUTPUT_LIBRARY_DIR}
-
- )
-
- endif()
-
endif()
-
-
set(parent_target_arg)
-
2.14.1
-
-71
pkgs/development/compilers/llvm/13/compiler-rt/darwin-targetconditionals.patch
···
-
diff --git a/lib/sanitizer_common/sanitizer_mac.cpp b/lib/sanitizer_common/sanitizer_mac.cpp
-
--- a/lib/sanitizer_common/sanitizer_mac.cpp
-
+++ b/lib/sanitizer_common/sanitizer_mac.cpp
-
@@ -613,9 +613,15 @@ HandleSignalMode GetHandleSignalMode(int signum) {
-
// Offset example:
-
// XNU 17 -- macOS 10.13 -- iOS 11 -- tvOS 11 -- watchOS 4
-
constexpr u16 GetOSMajorKernelOffset() {
-
- if (TARGET_OS_OSX) return 4;
-
- if (TARGET_OS_IOS || TARGET_OS_TV) return 6;
-
- if (TARGET_OS_WATCH) return 13;
-
+#if TARGET_OS_OSX
-
+ return 4;
-
+#endif
-
+#if TARGET_OS_IOS || TARGET_OS_TV
-
+ return 6;
-
+#endif
-
+#if TARGET_OS_WATCH
-
+ return 13;
-
+#endif
-
}
-
-
using VersStr = char[64];
-
@@ -627,13 +633,13 @@ static uptr ApproximateOSVersionViaKernelVersion(VersStr vers) {
-
u16 os_major = kernel_major - offset;
-
-
const char *format = "%d.0";
-
- if (TARGET_OS_OSX) {
-
- if (os_major >= 16) { // macOS 11+
-
- os_major -= 5;
-
- } else { // macOS 10.15 and below
-
- format = "10.%d";
-
- }
-
+#if TARGET_OS_OSX
-
+ if (os_major >= 16) { // macOS 11+
-
+ os_major -= 5;
-
+ } else { // macOS 10.15 and below
-
+ format = "10.%d";
-
}
-
+#endif
-
return internal_snprintf(vers, sizeof(VersStr), format, os_major);
-
}
-
-
@@ -681,15 +687,14 @@ void ParseVersion(const char *vers, u16 *major, u16 *minor) {
-
// Aligned versions example:
-
// macOS 10.15 -- iOS 13 -- tvOS 13 -- watchOS 6
-
static void MapToMacos(u16 *major, u16 *minor) {
-
- if (TARGET_OS_OSX)
-
- return;
-
-
-
- if (TARGET_OS_IOS || TARGET_OS_TV)
-
+#if !TARGET_OS_OSX
-
+#if TARGET_OS_IOS || TARGET_OS_TV
-
*major += 2;
-
- else if (TARGET_OS_WATCH)
-
+#elif TARGET_OS_WATCH
-
*major += 9;
-
- else
-
+#else
-
UNREACHABLE("unsupported platform");
-
+#endif
-
-
if (*major >= 16) { // macOS 11+
-
*major -= 5;
-
@@ -697,6 +702,7 @@ static void MapToMacos(u16 *major, u16 *minor) {
-
*minor = *major;
-
*major = 10;
-
}
-
+#endif
-
}
-
-
static MacosVersion GetMacosAlignedVersionInternal() {
-36
pkgs/development/compilers/llvm/13/libunwind/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 81eddbc24879..e2afb2002150 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -23,6 +23,8 @@ set(LIBUNWIND_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx" CACHE PATH
-
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBUNWIND_STANDALONE_BUILD)
-
project(libunwind LANGUAGES C CXX ASM)
-
-
+ include(GNUInstallDirs)
-
+
-
set(PACKAGE_NAME libunwind)
-
set(PACKAGE_VERSION 13.0.0git)
-
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
-
@@ -116,7 +118,7 @@ set(CMAKE_MODULE_PATH
-
-
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-
set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
-
- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
-
+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
-
"Path where built libunwind libraries should be installed.")
-
if(LIBCXX_LIBDIR_SUBDIR)
-
string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR})
-
@@ -124,11 +126,11 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-
endif()
-
elseif(LLVM_LIBRARY_OUTPUT_INTDIR)
-
set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
-
- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH
-
+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} CACHE PATH
-
"Path where built libunwind libraries should be installed.")
-
else()
-
set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX})
-
- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH
-
+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} CACHE PATH
-
"Path where built libunwind libraries should be installed.")
-
endif()
-
-110
pkgs/development/compilers/llvm/13/lldb/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index b5633e21c56a..f2f1035e9238 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -10,6 +10,8 @@ set(CMAKE_MODULE_PATH
-
# If we are not building as part of LLVM, build LLDB as a standalone project,
-
# using LLVM as an external library.
-
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
-
+ include(GNUInstallDirs)
-
+
-
project(lldb)
-
include(LLDBStandalone)
-
-
diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake
-
index 4ed5c647c5d2..89f96e710d55 100644
-
--- a/cmake/modules/AddLLDB.cmake
-
+++ b/cmake/modules/AddLLDB.cmake
-
@@ -107,13 +107,13 @@ function(add_lldb_library name)
-
endif()
-
-
if(PARAM_SHARED)
-
- set(install_dest lib${LLVM_LIBDIR_SUFFIX})
-
+ set(install_dest ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
if(PARAM_INSTALL_PREFIX)
-
set(install_dest ${PARAM_INSTALL_PREFIX})
-
endif()
-
# RUNTIME is relevant for DLL platforms, FRAMEWORK for macOS
-
install(TARGETS ${name} COMPONENT ${name}
-
- RUNTIME DESTINATION bin
-
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-
LIBRARY DESTINATION ${install_dest}
-
ARCHIVE DESTINATION ${install_dest}
-
FRAMEWORK DESTINATION ${install_dest})
-
diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake
-
index 2fdf1502d055..37364341ff8b 100644
-
--- a/cmake/modules/LLDBConfig.cmake
-
+++ b/cmake/modules/LLDBConfig.cmake
-
@@ -225,7 +225,7 @@ include_directories(BEFORE
-
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
install(DIRECTORY include/
-
COMPONENT lldb-headers
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
FILES_MATCHING
-
PATTERN "*.h"
-
PATTERN ".cmake" EXCLUDE
-
@@ -233,7 +233,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
-
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
-
COMPONENT lldb-headers
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
FILES_MATCHING
-
PATTERN "*.h"
-
PATTERN ".cmake" EXCLUDE
-
diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt
-
index 734167e51bc5..f95761b5df58 100644
-
--- a/tools/intel-features/CMakeLists.txt
-
+++ b/tools/intel-features/CMakeLists.txt
-
@@ -65,4 +65,4 @@ if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
-
endif()
-
-
install(TARGETS lldbIntelFeatures
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
diff --git a/cmake/modules/LLDBStandalone.cmake b/cmake/modules/LLDBStandalone.cmake
-
index 752113b..010f187 100644
-
--- a/cmake/modules/LLDBStandalone.cmake
-
+++ b/cmake/modules/LLDBStandalone.cmake
-
@@ -62,7 +62,7 @@ endif()
-
-
# They are used as destination of target generators.
-
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
-
-set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
-
+set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
if(WIN32 OR CYGWIN)
-
# DLL platform -- put DLLs into bin.
-
set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index b5633e2..86e4738 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -79,7 +79,7 @@ if (LLDB_ENABLE_PYTHON)
-
if(LLDB_BUILD_FRAMEWORK)
-
set(lldb_python_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb")
-
else()
-
- set(lldb_python_target_dir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb")
-
+ set(lldb_python_target_dir "${CMAKE_INSTALL_LIBDIR}/../${LLDB_PYTHON_RELATIVE_PATH}/lldb")
-
endif()
-
get_target_property(lldb_python_bindings_dir swig_wrapper_python BINARY_DIR)
-
finish_swig_python("lldb-python" "${lldb_python_bindings_dir}" "${lldb_python_target_dir}")
-
diff --git a/source/API/CMakeLists.txt b/source/API/CMakeLists.txt
-
index b5633e2..86e4738 100644
-
--- a/source/API/CMakeLists.txt 2024-05-30 21:38:39.829955586 -0700
-
+++ b/source/API/CMakeLists.txt 2024-05-30 21:38:48.015673758 -0700
-
@@ -112,14 +112,6 @@
-
${option_install_prefix}
-
)
-
-
-# lib/pythonX.Y/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so,
-
-# which depends on lib/libLLVM*.so (BUILD_SHARED_LIBS) or lib/libLLVM-10git.so
-
-# (LLVM_LINK_LLVM_DYLIB). Add an additional rpath $ORIGIN/../../../../lib so
-
-# that _lldb.so can be loaded from Python.
-
-if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) AND UNIX AND NOT APPLE)
-
- set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}")
-
-endif()
-
-
-
if(Python3_RPATH)
-
set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "${Python3_RPATH}")
-
set_property(TARGET liblldb APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}")
-381
pkgs/development/compilers/llvm/13/llvm/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 135036f509d2..265c36f8211b 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -270,15 +270,21 @@ if (CMAKE_BUILD_TYPE AND
-
message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
-
endif()
-
-
+include(GNUInstallDirs)
-
+
-
set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
-
-
-set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
-
+set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING
-
+ "Path for binary subdirectory (defaults to 'bin')")
-
mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
-
-
set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING
-
"Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)")
-
mark_as_advanced(LLVM_UTILS_INSTALL_DIR)
-
-
+set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING
-
+ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" )
-
+
-
# They are used as destination of target generators.
-
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
-
set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
-
@@ -581,9 +587,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
-
option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON)
-
option (LLVM_ENABLE_BINDINGS "Build bindings." ON)
-
-
-set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html"
-
+set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html"
-
CACHE STRING "Doxygen-generated HTML documentation install directory")
-
-set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html"
-
+set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html"
-
CACHE STRING "OCamldoc-generated HTML documentation install directory")
-
-
option (LLVM_BUILD_EXTERNAL_COMPILER_RT
-
@@ -1048,7 +1054,7 @@ endif()
-
-
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
install(DIRECTORY include/llvm include/llvm-c
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
COMPONENT llvm-headers
-
FILES_MATCHING
-
PATTERN "*.def"
-
@@ -1059,7 +1065,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
)
-
-
install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
COMPONENT llvm-headers
-
FILES_MATCHING
-
PATTERN "*.def"
-
@@ -1073,13 +1079,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-
-
if (LLVM_INSTALL_MODULEMAPS)
-
install(DIRECTORY include/llvm include/llvm-c
-
- DESTINATION include
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-
COMPONENT llvm-headers
-
FILES_MATCHING
-
PATTERN "module.modulemap"
-
)
-
install(FILES include/llvm/module.install.modulemap
-
- DESTINATION include/llvm
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm
-
COMPONENT llvm-headers
-
RENAME "module.extern.modulemap"
-
)
-
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
-
index 9c2b85374307..5531ceeb2eeb 100644
-
--- a/cmake/modules/AddLLVM.cmake
-
+++ b/cmake/modules/AddLLVM.cmake
-
@@ -818,9 +818,9 @@ macro(add_llvm_library name)
-
get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella})
-
install(TARGETS ${name}
-
${export_to_llvmexports}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
- RUNTIME DESTINATION bin COMPONENT ${name})
-
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${name})
-
-
if (NOT LLVM_ENABLE_IDE)
-
add_llvm_install_targets(install-${name}
-
@@ -1036,7 +1036,7 @@ function(process_llvm_pass_plugins)
-
"set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})")
-
install(FILES
-
${llvm_cmake_builddir}/LLVMConfigExtensions.cmake
-
- DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
-
+ DESTINATION ${LLVM_INSTALL_CMAKE_DIR}
-
COMPONENT cmake-exports)
-
-
set(ExtensionDef "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def")
-
@@ -1250,7 +1250,7 @@ macro(add_llvm_example name)
-
endif()
-
add_llvm_executable(${name} ${ARGN})
-
if( LLVM_BUILD_EXAMPLES )
-
- install(TARGETS ${name} RUNTIME DESTINATION examples)
-
+ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
-
endif()
-
set_target_properties(${name} PROPERTIES FOLDER "Examples")
-
endmacro(add_llvm_example name)
-
@@ -1868,7 +1868,7 @@ function(llvm_install_library_symlink name dest type)
-
set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX})
-
set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX})
-
-
- set(output_dir lib${LLVM_LIBDIR_SUFFIX})
-
+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
if(WIN32 AND "${type}" STREQUAL "SHARED")
-
set(output_dir bin)
-
endif()
-
@@ -1879,7 +1879,7 @@ function(llvm_install_library_symlink name dest type)
-
-
endfunction()
-
-
-function(llvm_install_symlink name dest)
-
+function(llvm_install_symlink name dest output_dir)
-
cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN})
-
foreach(path ${CMAKE_MODULE_PATH})
-
if(EXISTS ${path}/LLVMInstallSymlink.cmake)
-
@@ -1902,7 +1902,7 @@ function(llvm_install_symlink name dest)
-
set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX})
-
-
install(SCRIPT ${INSTALL_SYMLINK}
-
- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})"
-
+ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})"
-
COMPONENT ${component})
-
-
if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE)
-
@@ -1985,7 +1985,8 @@ function(add_llvm_tool_symlink link_name target)
-
endif()
-
-
if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS)
-
- llvm_install_symlink(${link_name} ${target})
-
+ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR)
-
+ llvm_install_symlink(${link_name} ${target} ${output_dir})
-
endif()
-
endif()
-
endfunction()
-
@@ -2114,9 +2115,9 @@ function(llvm_setup_rpath name)
-
# Since BUILD_SHARED_LIBS is only recommended for use by developers,
-
# hardcode the rpath to build/install lib dir first in this mode.
-
# FIXME: update this when there is better solution.
-
- set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
elseif(UNIX)
-
- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
-
set_property(TARGET ${name} APPEND_STRING PROPERTY
-
LINK_FLAGS " -Wl,-z,origin ")
-
diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
-
index 554046b20edf..4d1ad980641e 100644
-
--- a/cmake/modules/AddOCaml.cmake
-
+++ b/cmake/modules/AddOCaml.cmake
-
@@ -144,9 +144,9 @@ function(add_ocaml_library name)
-
endforeach()
-
-
if( APPLE )
-
- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
elseif( UNIX )
-
- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
endif()
-
list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}")
-
-
diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake
-
index e80c3b5c1cac..482f6d715ef5 100644
-
--- a/cmake/modules/AddSphinxTarget.cmake
-
+++ b/cmake/modules/AddSphinxTarget.cmake
-
@@ -90,7 +90,7 @@ function (add_sphinx_target builder project)
-
endif()
-
elseif (builder STREQUAL html)
-
string(TOUPPER "${project}" project_upper)
-
- set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html"
-
+ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html"
-
CACHE STRING "HTML documentation install directory for ${project}")
-
-
# '/.' indicates: copy the contents of the directory directly into
-
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
-
index 51b6a4fdc284..4adc2acfc074 100644
-
--- a/cmake/modules/CMakeLists.txt
-
+++ b/cmake/modules/CMakeLists.txt
-
@@ -1,6 +1,6 @@
-
include(LLVMDistributionSupport)
-
-
-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
-
+set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')")
-
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
-
-
# First for users who use an installed LLVM, create the LLVMExports.cmake file.
-
@@ -109,13 +109,13 @@ foreach(p ${_count})
-
set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE}
-
get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)")
-
endforeach(p)
-
-set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include")
-
+set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
-
set(LLVM_CONFIG_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}")
-
set(LLVM_CONFIG_MAIN_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}")
-
-set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}")
-
+set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}")
-
set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}")
-
set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}")
-
-set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin")
-
+set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
-
-
# Generate a default location for lit
-
if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)
-
diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake
-
index 3e6a2c9a2648..52e14d955c60 100644
-
--- a/cmake/modules/LLVMInstallSymlink.cmake
-
+++ b/cmake/modules/LLVMInstallSymlink.cmake
-
@@ -4,7 +4,7 @@
-
-
function(install_symlink name target outdir)
-
set(DESTDIR $ENV{DESTDIR})
-
- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
-
+ set(bindir "${DESTDIR}${outdir}/")
-
-
message(STATUS "Creating ${name}")
-
-
diff --git a/docs/CMake.rst b/docs/CMake.rst
-
index f1ac2c7d4934..c6e1469b5e13 100644
-
--- a/docs/CMake.rst
-
+++ b/docs/CMake.rst
-
@@ -202,7 +202,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``.
-
**LLVM_LIBDIR_SUFFIX**:STRING
-
Extra suffix to append to the directory where libraries are to be
-
installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
-
- to install libraries to ``/usr/lib64``.
-
+ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``.
-
-
Rarely-used CMake variables
-
---------------------------
-
@@ -551,8 +551,8 @@ LLVM-specific variables
-
-
**LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING
-
The path to install Doxygen-generated HTML documentation to. This path can
-
- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to
-
- `share/doc/llvm/doxygen-html`.
-
+ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to
-
+ `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`.
-
-
**LLVM_LINK_LLVM_DYLIB**:BOOL
-
If enabled, tools will be linked with the libLLVM shared library. Defaults
-
@@ -792,9 +792,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``).
-
-
This file is available in two different locations.
-
-
-* ``<INSTALL_PREFIX>/lib/cmake/llvm/LLVMConfig.cmake`` where
-
- ``<INSTALL_PREFIX>`` is the install prefix of an installed version of LLVM.
-
- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``.
-
+* ``<LLVM_INSTALL_PACKAGE_DIR>LLVMConfig.cmake`` where
-
+ ``<LLVM_INSTALL_PACKAGE_DIR>`` is the location where LLVM CMake modules are
-
+ installed as part of an installed version of LLVM. This is typically
-
+ ``cmake/llvm/`` within the lib directory. On Linux, this is typically
-
+ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``.
-
-
* ``<LLVM_BUILD_ROOT>/lib/cmake/llvm/LLVMConfig.cmake`` where
-
``<LLVM_BUILD_ROOT>`` is the root of the LLVM build tree. **Note: this is only
-
diff --git a/examples/Bye/CMakeLists.txt b/examples/Bye/CMakeLists.txt
-
index bb96edb4b4bf..678c22fb43c8 100644
-
--- a/examples/Bye/CMakeLists.txt
-
+++ b/examples/Bye/CMakeLists.txt
-
@@ -14,6 +14,6 @@ if (NOT WIN32)
-
BUILDTREE_ONLY
-
)
-
-
- install(TARGETS ${name} RUNTIME DESTINATION examples)
-
+ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
-
set_target_properties(${name} PROPERTIES FOLDER "Examples")
-
endif()
-
diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt
-
index b46319f24fc8..2feabd1954e4 100644
-
--- a/include/llvm/CMakeLists.txt
-
+++ b/include/llvm/CMakeLists.txt
-
@@ -5,5 +5,5 @@ add_subdirectory(Frontend)
-
# If we're doing an out-of-tree build, copy a module map for generated
-
# header files into the build area.
-
if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-
- configure_file(module.modulemap.build module.modulemap COPYONLY)
-
+ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY)
-
endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-
index ebe5b73a5c65..70c497be12f5 100644
-
--- a/tools/llvm-config/BuildVariables.inc.in
-
+++ b/tools/llvm-config/BuildVariables.inc.in
-
@@ -23,6 +23,10 @@
-
#define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
-
#define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
-
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
-
+#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@"
-
+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@"
-
+#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
-
+#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@"
-
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
-
#define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
-
#define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"
-
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-
index 1a2f04552d13..44fa7d3eec6b 100644
-
--- a/tools/llvm-config/llvm-config.cpp
-
+++ b/tools/llvm-config/llvm-config.cpp
-
@@ -357,12 +357,26 @@ int main(int argc, char **argv) {
-
("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
-
} else {
-
ActivePrefix = CurrentExecPrefix;
-
- ActiveIncludeDir = ActivePrefix + "/include";
-
- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
-
- sys::fs::make_absolute(ActivePrefix, path);
-
- ActiveBinDir = std::string(path.str());
-
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
-
- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
-
+ {
-
+ SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR));
-
+ sys::fs::make_absolute(ActivePrefix, path);
-
+ ActiveIncludeDir = std::string(path.str());
-
+ }
-
+ {
-
+ SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR));
-
+ sys::fs::make_absolute(ActivePrefix, path);
-
+ ActiveBinDir = std::string(path.str());
-
+ }
-
+ {
-
+ SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX));
-
+ sys::fs::make_absolute(ActivePrefix, path);
-
+ ActiveLibDir = std::string(path.str());
-
+ }
-
+ {
-
+ SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR));
-
+ sys::fs::make_absolute(ActivePrefix, path);
-
+ ActiveCMakeDir = std::string(path.str());
-
+ }
-
ActiveIncludeOption = "-I" + ActiveIncludeDir;
-
}
-
-
diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt
-
index 0af29ad762c5..37b99b83e35c 100644
-
--- a/tools/lto/CMakeLists.txt
-
+++ b/tools/lto/CMakeLists.txt
-
@@ -33,7 +33,7 @@ add_llvm_library(${LTO_LIBRARY_NAME} ${LTO_LIBRARY_TYPE} INSTALL_WITH_TOOLCHAIN
-
${SOURCES} DEPENDS intrinsics_gen)
-
-
install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
-
- DESTINATION include/llvm-c
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c
-
COMPONENT LTO)
-
-
if (APPLE)
-
diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt
-
index ead73ec13a8f..250362021f17 100644
-
--- a/tools/opt-viewer/CMakeLists.txt
-
+++ b/tools/opt-viewer/CMakeLists.txt
-
@@ -8,7 +8,7 @@ set (files
-
-
foreach (file ${files})
-
install(PROGRAMS ${file}
-
- DESTINATION share/opt-viewer
-
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer
-
COMPONENT opt-viewer)
-
endforeach (file)
-
-
diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt
-
index 865436247270..ce1daa62f6ab 100644
-
--- a/tools/remarks-shlib/CMakeLists.txt
-
+++ b/tools/remarks-shlib/CMakeLists.txt
-
@@ -19,7 +19,7 @@ if(LLVM_ENABLE_PIC)
-
endif()
-
-
install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
-
- DESTINATION include/llvm-c
-
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c
-
COMPONENT Remarks)
-
-
if (APPLE)
-50
pkgs/development/compilers/llvm/14/clang/gnu-install-dirs.patch
···
-
diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake
-
index 9bbbfc032b7d..947bd0da865d 100644
-
--- a/cmake/modules/AddClang.cmake
-
+++ b/cmake/modules/AddClang.cmake
-
@@ -119,8 +119,8 @@ macro(add_clang_library name)
-
install(TARGETS ${lib}
-
COMPONENT ${lib}
-
${export_to_clangtargets}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-
-
if (NOT LLVM_ENABLE_IDE)
-
@@ -175,7 +175,7 @@ endmacro()
-
macro(add_clang_symlink name dest)
-
add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE)
-
# Always generate install targets
-
- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE)
-
+ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE)
-
endmacro()
-
-
function(clang_target_link_libraries target type)
-
diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
-
index 078988980c52..14b58614b40a 100644
-
--- a/lib/Headers/CMakeLists.txt
-
+++ b/lib/Headers/CMakeLists.txt
-
@@ -234,7 +234,7 @@ set_target_properties(clang-resource-headers PROPERTIES
-
FOLDER "Misc"
-
RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
-
-
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-
+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-
-
install(
-
FILES ${files} ${generated_files}
-
diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
-
index 4e0647971ab4..68dd67fcc476 100644
-
--- a/tools/libclang/CMakeLists.txt
-
+++ b/tools/libclang/CMakeLists.txt
-
@@ -216,7 +216,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS})
-
COMPONENT
-
libclang-python-bindings
-
DESTINATION
-
- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
-
+ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
-
endforeach()
-
if(NOT LLVM_ENABLE_IDE)
-
add_custom_target(libclang-python-bindings)
-65
pkgs/development/compilers/llvm/14/compiler-rt/armv6-scudo-libatomic.patch
···
-
From a56bb19a9dc303a50ef12d83cd24c2395bf81076 Mon Sep 17 00:00:00 2001
-
From: Ben Wolsieffer <benwolsieffer@gmail.com>
-
Date: Wed, 7 Dec 2022 21:25:46 -0500
-
Subject: [PATCH] [scudo][standalone] Use CheckAtomic to decide to link to
-
libatomic
-
-
Standalone scudo uses the atomic operation builtin functions, which require
-
linking to libatomic on some platforms. Currently, this is done in an ad-hoc
-
manner. MIPS platforms always link to libatomic, and the tests are always linked
-
to it as well. libatomic is required on base ARMv6 (but not ARMv6K), but it is
-
currently not linked, causing the build to fail.
-
-
This patch replaces this ad-hoc logic with the CheckAtomic CMake module already
-
used in other parts of LLVM. The CheckAtomic module checks whether std::atomic
-
requires libatomic, which is not strictly the same as checking the atomic
-
builtins, but should have the same results as far as I know. If this is
-
problematic, a custom version of CheckAtomic could be used to specifically test
-
the builtins.
-
---
-
compiler-rt/lib/scudo/standalone/CMakeLists.txt | 7 +++++++
-
compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt | 4 +---
-
2 files changed, 8 insertions(+), 3 deletions(-)
-
-
diff --git a/lib/scudo/standalone/CMakeLists.txt b/lib/scudo/standalone/CMakeLists.txt
-
index ae5c354768c8..eb27374ca520 100644
-
--- a/lib/scudo/standalone/CMakeLists.txt
-
+++ b/lib/scudo/standalone/CMakeLists.txt
-
@@ -1,5 +1,8 @@
-
add_compiler_rt_component(scudo_standalone)
-
-
+include(DetermineGCCCompatible)
-
+include(CheckAtomic)
-
+
-
include_directories(../.. include)
-
-
set(SCUDO_CFLAGS)
-
@@ -34,6 +37,10 @@ list(APPEND SCUDO_LINK_FLAGS -Wl,-z,defs,-z,now,-z,relro)
-
-
list(APPEND SCUDO_LINK_FLAGS -ffunction-sections -fdata-sections -Wl,--gc-sections)
-
-
+if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
-
+ list(APPEND SCUDO_LINK_FLAGS -latomic)
-
+endif()
-
+
-
# We don't use the C++ standard library, so avoid including it by mistake.
-
append_list_if(COMPILER_RT_HAS_NOSTDLIBXX_FLAG -nostdlib++ SCUDO_LINK_FLAGS)
-
-
diff --git a/lib/scudo/standalone/tests/CMakeLists.txt b/lib/scudo/standalone/tests/CMakeLists.txt
-
index 6d0936cbb5c1..70a5a7e959c1 100644
-
--- a/lib/scudo/standalone/tests/CMakeLists.txt
-
+++ b/lib/scudo/standalone/tests/CMakeLists.txt
-
@@ -38,9 +38,7 @@ set(LINK_FLAGS
-
${SANITIZER_TEST_CXX_LIBRARIES}
-
)
-
list(APPEND LINK_FLAGS -pthread)
-
-# Linking against libatomic is required with some compilers
-
-check_library_exists(atomic __atomic_load_8 "" COMPILER_RT_HAS_LIBATOMIC)
-
-if (COMPILER_RT_HAS_LIBATOMIC)
-
+if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
-
list(APPEND LINK_FLAGS -latomic)
-
endif()
-
-
--
-
2.38.1
-
-42
pkgs/development/compilers/llvm/14/compiler-rt/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 3a41aa43e406..f000cee6eae0 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -5,6 +5,8 @@
-
-
cmake_minimum_required(VERSION 3.13.4)
-
-
+include(GNUInstallDirs)
-
+
-
# Check if compiler-rt is built as a standalone project.
-
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD)
-
project(CompilerRT C CXX ASM)
-
diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
-
index d7b0124f3546..3e111146df4d 100644
-
--- a/cmake/base-config-ix.cmake
-
+++ b/cmake/base-config-ix.cmake
-
@@ -67,7 +67,7 @@ if (LLVM_TREE_AVAILABLE)
-
else()
-
# Take output dir and install path from the user.
-
set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH
-
- "Path where built compiler-rt libraries should be stored.")
-
+ "Path where built compiler-rt build artifacts should be stored.")
-
set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH
-
"Path where built compiler-rt executables should be stored.")
-
set(COMPILER_RT_INSTALL_PATH "" CACHE PATH
-
@@ -99,13 +99,13 @@ endif()
-
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-
set(COMPILER_RT_OUTPUT_LIBRARY_DIR
-
${COMPILER_RT_OUTPUT_DIR}/lib)
-
- extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" lib)
-
+ extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}")
-
set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH
-
"Path where built compiler-rt libraries should be installed.")
-
else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-
set(COMPILER_RT_OUTPUT_LIBRARY_DIR
-
${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR})
-
- extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "lib/${COMPILER_RT_OS_DIR}")
-
+ extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}/${COMPILER_RT_OS_DIR}")
-
set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH
-
"Path where built compiler-rt libraries should be installed.")
-
endif()
-21
pkgs/development/compilers/llvm/14/libunwind/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -147,7 +147,7 @@ set(LIBUNWIND_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
-
-
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-
set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
-
- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
-
+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
-
"Path where built libunwind libraries should be installed.")
-
if(LIBCXX_LIBDIR_SUBDIR)
-
string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR})
-
@@ -159,7 +159,7 @@ else()
-
else()
-
set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX})
-
endif()
-
- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH
-
+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH
-
"Path where built libunwind libraries should be installed.")
-
endif()
-
-13
pkgs/development/compilers/llvm/14/lld/fix-root-src-dir.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 9bcc135665d0..d38679ed41e9 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -74,7 +74,7 @@ if(LLD_BUILT_STANDALONE)
-
-
set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to llvm/include")
-
set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")
-
- set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree")
-
+ set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree")
-
-
find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
-
NO_DEFAULT_PATH)
-22
pkgs/development/compilers/llvm/14/lld/gnu-install-dirs.patch
···
-
diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake
-
index dd2898ce6236..ebbea040ff54 100644
-
--- a/cmake/modules/AddLLD.cmake
-
+++ b/cmake/modules/AddLLD.cmake
-
@@ -18,8 +18,8 @@ macro(add_lld_library name)
-
install(TARGETS ${name}
-
COMPONENT ${name}
-
${export_to_lldtargets}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-
-
if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
-
@@ -62,5 +62,5 @@ endmacro()
-
macro(add_lld_symlink name dest)
-
add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE)
-
# Always generate install targets
-
- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE)
-
+ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE)
-
endmacro()
-19
pkgs/development/compilers/llvm/14/llvm/gnu-install-dirs-polly.patch
···
-
This is the one remaining Polly install dirs related change that hasn't made it
-
into upstream yet; previously this patch file also included:
-
https://reviews.llvm.org/D117541
-
-
diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake
-
index 518a09b45a42..bd9d6f5542ad 100644
-
--- a/tools/polly/cmake/polly_macros.cmake
-
+++ b/tools/polly/cmake/polly_macros.cmake
-
@@ -44,8 +44,8 @@ macro(add_polly_library name)
-
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly")
-
install(TARGETS ${name}
-
EXPORT LLVMExports
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
endif()
-
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
-
endmacro(add_polly_library)
-220
pkgs/development/compilers/llvm/14/llvm/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index fec956091cd5..5a766f5c5d7c 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -303,6 +303,9 @@ set(LLVM_EXAMPLES_INSTALL_DIR "examples" CACHE STRING
-
"Path for examples subdirectory (enabled by LLVM_BUILD_EXAMPLES=ON) (defaults to 'examples')")
-
mark_as_advanced(LLVM_EXAMPLES_INSTALL_DIR)
-
-
+set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING
-
+ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" )
-
+
-
# They are used as destination of target generators.
-
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
-
set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
-
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
-
index fed1fec7d72e..4baed19b9e98 100644
-
--- a/cmake/modules/AddLLVM.cmake
-
+++ b/cmake/modules/AddLLVM.cmake
-
@@ -838,8 +838,8 @@ macro(add_llvm_library name)
-
get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella})
-
install(TARGETS ${name}
-
${export_to_llvmexports}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name})
-
-
if (NOT LLVM_ENABLE_IDE)
-
@@ -1056,7 +1056,7 @@ function(process_llvm_pass_plugins)
-
"set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})")
-
install(FILES
-
${llvm_cmake_builddir}/LLVMConfigExtensions.cmake
-
- DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
-
+ DESTINATION ${LLVM_INSTALL_CMAKE_DIR}
-
COMPONENT cmake-exports)
-
-
set(ExtensionDef "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def")
-
@@ -1902,7 +1902,7 @@ function(llvm_install_library_symlink name dest type)
-
set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX})
-
set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX})
-
-
- set(output_dir lib${LLVM_LIBDIR_SUFFIX})
-
+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
if(WIN32 AND "${type}" STREQUAL "SHARED")
-
set(output_dir bin)
-
endif()
-
@@ -1913,7 +1913,7 @@ function(llvm_install_library_symlink name dest type)
-
-
endfunction()
-
-
-function(llvm_install_symlink name dest)
-
+function(llvm_install_symlink name dest output_dir)
-
cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN})
-
foreach(path ${CMAKE_MODULE_PATH})
-
if(EXISTS ${path}/LLVMInstallSymlink.cmake)
-
@@ -1936,7 +1936,7 @@ function(llvm_install_symlink name dest)
-
set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX})
-
-
install(SCRIPT ${INSTALL_SYMLINK}
-
- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})"
-
+ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})"
-
COMPONENT ${component})
-
-
if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE)
-
@@ -2019,7 +2019,8 @@ function(add_llvm_tool_symlink link_name target)
-
endif()
-
-
if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS)
-
- llvm_install_symlink(${link_name} ${target})
-
+ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR)
-
+ llvm_install_symlink(${link_name} ${target} ${output_dir})
-
endif()
-
endif()
-
endfunction()
-
@@ -2148,9 +2149,9 @@ function(llvm_setup_rpath name)
-
# Since BUILD_SHARED_LIBS is only recommended for use by developers,
-
# hardcode the rpath to build/install lib dir first in this mode.
-
# FIXME: update this when there is better solution.
-
- set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
elseif(UNIX)
-
- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
-
set_property(TARGET ${name} APPEND_STRING PROPERTY
-
LINK_FLAGS " -Wl,-z,origin ")
-
diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
-
index 891c9e6d618c..8d963f3b0069 100644
-
--- a/cmake/modules/AddOCaml.cmake
-
+++ b/cmake/modules/AddOCaml.cmake
-
@@ -147,9 +147,9 @@ function(add_ocaml_library name)
-
endforeach()
-
-
if( APPLE )
-
- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
elseif( UNIX )
-
- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
endif()
-
list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}")
-
-
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
-
index cea0c1df0a14..eedcd9450312 100644
-
--- a/cmake/modules/CMakeLists.txt
-
+++ b/cmake/modules/CMakeLists.txt
-
@@ -2,7 +2,7 @@ include(ExtendPath)
-
include(LLVMDistributionSupport)
-
include(FindPrefixFromConfig)
-
-
-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
-
+set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')")
-
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
-
-
# First for users who use an installed LLVM, create the LLVMExports.cmake file.
-
@@ -122,7 +122,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS
-
)
-
list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS)
-
-
-extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}")
-
+extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}")
-
set(LLVM_CONFIG_LIBRARY_DIRS
-
"${LLVM_CONFIG_LIBRARY_DIR}"
-
# FIXME: Should there be other entries here?
-
diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake
-
index b5c35f706cb7..9261ab797de6 100644
-
--- a/cmake/modules/LLVMInstallSymlink.cmake
-
+++ b/cmake/modules/LLVMInstallSymlink.cmake
-
@@ -6,7 +6,7 @@ include(GNUInstallDirs)
-
-
function(install_symlink name target outdir)
-
set(DESTDIR $ENV{DESTDIR})
-
- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}")
-
+ set(bindir "${DESTDIR}${outdir}/")
-
-
message(STATUS "Creating ${name}")
-
-
diff --git a/docs/CMake.rst b/docs/CMake.rst
-
index 044ec8a4d39d..504d0eac3ade 100644
-
--- a/docs/CMake.rst
-
+++ b/docs/CMake.rst
-
@@ -224,7 +224,7 @@ description is in `LLVM-related variables`_ below.
-
**LLVM_LIBDIR_SUFFIX**:STRING
-
Extra suffix to append to the directory where libraries are to be
-
installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
-
- to install libraries to ``/usr/lib64``.
-
+ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``.
-
-
**LLVM_PARALLEL_{COMPILE,LINK}_JOBS**:STRING
-
Building the llvm toolchain can use a lot of resources, particularly
-
@@ -910,9 +910,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``).
-
-
This file is available in two different locations.
-
-
-* ``<INSTALL_PREFIX>/lib/cmake/llvm/LLVMConfig.cmake`` where
-
- ``<INSTALL_PREFIX>`` is the install prefix of an installed version of LLVM.
-
- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``.
-
+* ``<LLVM_INSTALL_PACKAGE_DIR>LLVMConfig.cmake`` where
-
+ ``<LLVM_INSTALL_PACKAGE_DIR>`` is the location where LLVM CMake modules are
-
+ installed as part of an installed version of LLVM. This is typically
-
+ ``cmake/llvm/`` within the lib directory. On Linux, this is typically
-
+ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``.
-
-
* ``<LLVM_BUILD_ROOT>/lib/cmake/llvm/LLVMConfig.cmake`` where
-
``<LLVM_BUILD_ROOT>`` is the root of the LLVM build tree. **Note: this is only
-
diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt
-
index b46319f24fc8..2feabd1954e4 100644
-
--- a/include/llvm/CMakeLists.txt
-
+++ b/include/llvm/CMakeLists.txt
-
@@ -5,5 +5,5 @@ add_subdirectory(Frontend)
-
# If we're doing an out-of-tree build, copy a module map for generated
-
# header files into the build area.
-
if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-
- configure_file(module.modulemap.build module.modulemap COPYONLY)
-
+ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY)
-
endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-
index abbb8a450da6..70c497be12f5 100644
-
--- a/tools/llvm-config/BuildVariables.inc.in
-
+++ b/tools/llvm-config/BuildVariables.inc.in
-
@@ -23,7 +23,10 @@
-
#define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
-
#define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
-
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
-
+#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@"
-
+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@"
-
#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
-
+#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@"
-
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
-
#define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
-
#define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"
-
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-
index 8ed88f33ead4..5e7184bab90d 100644
-
--- a/tools/llvm-config/llvm-config.cpp
-
+++ b/tools/llvm-config/llvm-config.cpp
-
@@ -363,12 +363,20 @@ int main(int argc, char **argv) {
-
ActiveIncludeDir = std::string(Path.str());
-
}
-
{
-
- SmallString<256> Path(LLVM_TOOLS_INSTALL_DIR);
-
+ SmallString<256> Path(LLVM_INSTALL_BINDIR);
-
sys::fs::make_absolute(ActivePrefix, Path);
-
ActiveBinDir = std::string(Path.str());
-
}
-
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
-
- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
-
+ {
-
+ SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX);
-
+ sys::fs::make_absolute(ActivePrefix, Path);
-
+ ActiveLibDir = std::string(Path.str());
-
+ }
-
+ {
-
+ SmallString<256> Path(LLVM_INSTALL_CMAKEDIR);
-
+ sys::fs::make_absolute(ActivePrefix, Path);
-
+ ActiveCMakeDir = std::string(Path.str());
-
+ }
-
ActiveIncludeOption = "-I" + ActiveIncludeDir;
-
}
-
-45
pkgs/development/compilers/llvm/14/openmp/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -24,7 +24,7 @@ if (OPENMP_STANDALONE_BUILD)
-
set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING
-
"Suffix of lib installation directory, e.g. 64 => lib64")
-
# Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR.
-
- set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}")
-
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}")
-
-
# Group test settings.
-
set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
-
@@ -35,7 +35,7 @@ if (OPENMP_STANDALONE_BUILD)
-
else()
-
set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
-
# If building in tree, we honor the same install suffix LLVM uses.
-
- set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
-
if (NOT MSVC)
-
set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
-
diff --git a/libomptarget/plugins/amdgpu/CMakeLists.txt b/libomptarget/plugins/amdgpu/CMakeLists.txt
-
--- a/libomptarget/plugins/amdgpu/CMakeLists.txt
-
+++ b/libomptarget/plugins/amdgpu/CMakeLists.txt
-
@@ -74,7 +74,7 @@ add_library(omptarget.rtl.amdgpu SHARED
-
-
# Install plugin under the lib destination folder.
-
# When we build for debug, OPENMP_LIBDIR_SUFFIX get set to -debug
-
-install(TARGETS omptarget.rtl.amdgpu LIBRARY DESTINATION "lib${OPENMP_LIBDIR_SUFFIX}")
-
+install(TARGETS omptarget.rtl.amdgpu LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}")
-
set_property(TARGET omptarget.rtl.amdgpu PROPERTY INSTALL_RPATH_USE_LINK_PATH ON)
-
-
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
-
diff --git a/libomptarget/plugins/ve/CMakeLists.txt b/libomptarget/plugins/ve/CMakeLists.txt
-
--- a/libomptarget/plugins/ve/CMakeLists.txt
-
+++ b/libomptarget/plugins/ve/CMakeLists.txt
-
@@ -32,7 +32,7 @@ if(${LIBOMPTARGET_DEP_VEO_FOUND})
-
-
# Install plugin under the lib destination folder.
-
install(TARGETS "omptarget.rtl.${tmachine_libname}"
-
- LIBRARY DESTINATION lib${OPENMP_LIBDIR_SUFFIX})
-
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX})
-
-
target_link_libraries(
-
"omptarget.rtl.${tmachine_libname}"
-12
pkgs/development/compilers/llvm/14/openmp/run-lit-directly.patch
···
-
diff --git a/cmake/OpenMPTesting.cmake b/cmake/OpenMPTesting.cmake
-
--- a/cmake/OpenMPTesting.cmake
-
+++ b/cmake/OpenMPTesting.cmake
-
@@ -185,7 +185,7 @@ function(add_openmp_testsuite target comment)
-
if (${OPENMP_STANDALONE_BUILD})
-
set(LIT_ARGS ${OPENMP_LIT_ARGS} ${ARG_ARGS})
-
add_custom_target(${target}
-
- COMMAND ${PYTHON_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS}
-
+ COMMAND ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS}
-
COMMENT ${comment}
-
DEPENDS ${ARG_DEPENDS}
-
USES_TERMINAL
-105
pkgs/development/compilers/llvm/15/clang/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index c27beec313d7..480f13e73c9f 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -78,15 +78,17 @@ if(CLANG_BUILT_STANDALONE)
-
if (NOT LLVM_CONFIG_FOUND)
-
# Pull values from LLVMConfig.cmake. We can drop this once the llvm-config
-
# path is removed.
-
- set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}")
-
+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
-
set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
-
# N.B. this is just a default value, the CACHE PATHs below can be overriden.
-
set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
-
set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}")
-
set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}")
-
+ else()
-
+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
-
endif()
-
-
- set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to llvm/include")
-
+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
-
set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")
-
set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree")
-
set(LLVM_TOOLS_BINARY_DIR "${TOOLS_BINARY_DIR}" CACHE PATH "Path to llvm/bin")
-
@@ -128,7 +130,7 @@ if(CLANG_BUILT_STANDALONE)
-
set(LLVM_INCLUDE_TESTS ON)
-
endif()
-
-
- include_directories("${LLVM_BINARY_DIR}/include" "${LLVM_MAIN_INCLUDE_DIR}")
-
+ include_directories(${LLVM_INCLUDE_DIRS})
-
link_directories("${LLVM_LIBRARY_DIR}")
-
-
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
-
diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake
-
index 21ac332e4f5f..b16c314bd1e2 100644
-
--- a/cmake/modules/AddClang.cmake
-
+++ b/cmake/modules/AddClang.cmake
-
@@ -119,8 +119,8 @@ macro(add_clang_library name)
-
install(TARGETS ${lib}
-
COMPONENT ${lib}
-
${export_to_clangtargets}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-
-
if (NOT LLVM_ENABLE_IDE)
-
diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
-
index 6e2060991b92..b9bc930d26b8 100644
-
--- a/lib/Headers/CMakeLists.txt
-
+++ b/lib/Headers/CMakeLists.txt
-
@@ -420,7 +420,7 @@ add_header_target("openmp-resource-headers" ${openmp_wrapper_files})
-
add_header_target("windows-resource-headers" ${windows_only_files})
-
add_header_target("utility-resource-headers" ${utility_files})
-
-
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-
+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-
-
#############################################################
-
# Install rules for the catch-all clang-resource-headers target
-
diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
-
index 8d95d0900e8c..ebc70ff7526d 100644
-
--- a/tools/libclang/CMakeLists.txt
-
+++ b/tools/libclang/CMakeLists.txt
-
@@ -180,7 +180,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS})
-
COMPONENT
-
libclang-python-bindings
-
DESTINATION
-
- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
-
+ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
-
endforeach()
-
if(NOT LLVM_ENABLE_IDE)
-
add_custom_target(libclang-python-bindings)
-
diff --git a/tools/scan-build-py/CMakeLists.txt b/tools/scan-build-py/CMakeLists.txt
-
index 061dc7ef4dd9..adc54b2edc32 100644
-
--- a/tools/scan-build-py/CMakeLists.txt
-
+++ b/tools/scan-build-py/CMakeLists.txt
-
@@ -88,7 +88,7 @@ foreach(lib ${LibScanbuild})
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib})
-
install(PROGRAMS lib/libscanbuild/${lib}
-
- DESTINATION lib/libscanbuild
-
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild"
-
COMPONENT scan-build-py)
-
endforeach()
-
-
@@ -106,7 +106,7 @@ foreach(resource ${LibScanbuildResources})
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource})
-
install(PROGRAMS lib/libscanbuild/resources/${resource}
-
- DESTINATION lib/libscanbuild/resources
-
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild/resources"
-
COMPONENT scan-build-py)
-
endforeach()
-
-
@@ -122,7 +122,7 @@ foreach(lib ${LibEar})
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib})
-
install(PROGRAMS lib/libear/${lib}
-
- DESTINATION lib/libear
-
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libear"
-
COMPONENT scan-build-py)
-
endforeach()
-
-29
pkgs/development/compilers/llvm/15/clang/purity.patch
···
-
From 4add81bba40dcec62c4ea4481be8e35ac53e89d8 Mon Sep 17 00:00:00 2001
-
From: Will Dietz <w@wdtz.org>
-
Date: Thu, 18 May 2017 11:56:12 -0500
-
Subject: [PATCH] "purity" patch for 5.0
-
-
---
-
lib/Driver/ToolChains/Gnu.cpp | 7 -------
-
1 file changed, 7 deletions(-)
-
-
diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
-
index fe3c0191bb..c6a482bece 100644
-
--- a/lib/Driver/ToolChains/Gnu.cpp
-
+++ b/lib/Driver/ToolChains/Gnu.cpp
-
@@ -487,13 +487,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
-
} else {
-
if (Args.hasArg(options::OPT_rdynamic))
-
CmdArgs.push_back("-export-dynamic");
-
-
- if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE &&
-
- !Args.hasArg(options::OPT_r)) {
-
- CmdArgs.push_back("-dynamic-linker");
-
- CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) +
-
- ToolChain.getDynamicLinker(Args)));
-
- }
-
}
-
-
CmdArgs.push_back("-o");
-
--
-
2.11.0
pkgs/development/compilers/llvm/15/compiler-rt/X86-support-extension.patch pkgs/development/compilers/llvm/18/compiler-rt/X86-support-extension.patch
pkgs/development/compilers/llvm/15/compiler-rt/armv6-scudo-libatomic.patch pkgs/development/compilers/llvm/18/compiler-rt/armv6-scudo-libatomic.patch
-20
pkgs/development/compilers/llvm/15/compiler-rt/gnu-install-dirs.patch
···
-
diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
-
index 8a6219568b3f..30ee68a47ccf 100644
-
--- a/cmake/base-config-ix.cmake
-
+++ b/cmake/base-config-ix.cmake
-
@@ -100,13 +100,13 @@ endif()
-
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-
set(COMPILER_RT_OUTPUT_LIBRARY_DIR
-
${COMPILER_RT_OUTPUT_DIR}/lib)
-
- extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" lib)
-
+ extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}")
-
set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH
-
"Path where built compiler-rt libraries should be installed.")
-
else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-
set(COMPILER_RT_OUTPUT_LIBRARY_DIR
-
${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR})
-
- extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "lib/${COMPILER_RT_OS_DIR}")
-
+ extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}/${COMPILER_RT_OS_DIR}")
-
set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH
-
"Path where built compiler-rt libraries should be installed.")
-
endif()
-22
pkgs/development/compilers/llvm/15/libunwind/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 5a06805f05f1..86a50329e6a8 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -117,7 +117,7 @@ set(LIBUNWIND_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
-
-
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-
set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
-
- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
-
+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
-
"Path where built libunwind libraries should be installed.")
-
if(LIBCXX_LIBDIR_SUBDIR)
-
string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR})
-
@@ -129,7 +129,7 @@ else()
-
else()
-
set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX})
-
endif()
-
- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH
-
+ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH
-
"Path where built libunwind libraries should be installed.")
-
endif()
-
-46
pkgs/development/compilers/llvm/15/lld/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index dcc649629a4b..58dca54642e4 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -70,13 +70,15 @@ if(LLD_BUILT_STANDALONE)
-
if (NOT LLVM_CONFIG_FOUND)
-
# Pull values from LLVMConfig.cmake. We can drop this once the llvm-config
-
# path is removed.
-
- set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}")
-
+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
-
set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
-
# N.B. this is just a default value, the CACHE PATHs below can be overridden.
-
set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
-
+ else()
-
+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
-
endif()
-
-
- set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to llvm/include")
-
+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
-
set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")
-
set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree")
-
-
@@ -95,7 +97,7 @@ if(LLD_BUILT_STANDALONE)
-
-
set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
-
-
- include_directories("${LLVM_BINARY_DIR}/include" ${LLVM_INCLUDE_DIRS})
-
+ include_directories(${LLVM_INCLUDE_DIRS})
-
link_directories(${LLVM_LIBRARY_DIRS})
-
-
if(LLVM_INCLUDE_TESTS)
-
diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake
-
index d3924f7243d4..42a7cd62281c 100644
-
--- a/cmake/modules/AddLLD.cmake
-
+++ b/cmake/modules/AddLLD.cmake
-
@@ -18,8 +18,8 @@ macro(add_lld_library name)
-
install(TARGETS ${name}
-
COMPONENT ${name}
-
${export_to_lldtargets}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-
-
if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
-46
pkgs/development/compilers/llvm/15/lldb/procfs.patch
···
-
--- a/source/Plugins/Process/Linux/Procfs.h
-
+++ b/source/Plugins/Process/Linux/Procfs.h
-
@@ -10,6 +10,13 @@
-
// sys/procfs.h on Android/Linux for all supported architectures.
-
-
#include <sys/ptrace.h>
-
+#include <asm/ptrace.h>
-
+
-
+// on i686 preprocessor symbols with these register names are defined as
-
+// numeric constants; these symbols clash with identifier names used in
-
+// `llvm/Support/VirtualFileSystem.h` and `llvm/ADT/SmallVector.h`
-
+#undef FS
-
+#undef CS
-
-
#include "lldb/lldb-types.h"
-
-
@@ -17,23 +24,13 @@
-
-
#include <vector>
-
-
-#ifdef __ANDROID__
-
-#if defined(__arm64__) || defined(__aarch64__)
-
-typedef unsigned long elf_greg_t;
-
-typedef elf_greg_t
-
- elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
-
-typedef struct user_fpsimd_state elf_fpregset_t;
-
-#ifndef NT_FPREGSET
-
-#define NT_FPREGSET NT_PRFPREG
-
-#endif // NT_FPREGSET
-
-#elif defined(__mips__)
-
-#ifndef NT_FPREGSET
-
-#define NT_FPREGSET NT_PRFPREG
-
-#endif // NT_FPREGSET
-
-#endif
-
-#else // __ANDROID__
-
+#if !defined(__GLIBC__) && defined(__powerpc__)
-
+#define pt_regs musl_pt_regs
-
+#include <sys/procfs.h>
-
+#undef pt_regs
-
+#else
-
#include <sys/procfs.h>
-
-#endif // __ANDROID__
-
+#endif
-
-
namespace lldb_private {
-
namespace process_linux {
-138
pkgs/development/compilers/llvm/15/llvm/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 45399dc0537e..5d946e9e6583 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -942,7 +942,7 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "")
-
add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src
-
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime)
-
install(TARGETS tf_xla_runtime EXPORT LLVMExports
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
-
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
-
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime)
-
# Once we add more modules, we should handle this more automatically.
-
if (DEFINED LLVM_OVERRIDE_MODEL_HEADER_INLINERSIZEMODEL)
-
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
-
index 057431208322..56f0dcb258da 100644
-
--- a/cmake/modules/AddLLVM.cmake
-
+++ b/cmake/modules/AddLLVM.cmake
-
@@ -844,8 +844,8 @@ macro(add_llvm_library name)
-
get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella})
-
install(TARGETS ${name}
-
${export_to_llvmexports}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name})
-
-
if (NOT LLVM_ENABLE_IDE)
-
@@ -2007,7 +2007,7 @@ function(llvm_install_library_symlink name dest type)
-
set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX})
-
set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX})
-
-
- set(output_dir lib${LLVM_LIBDIR_SUFFIX})
-
+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
if(WIN32 AND "${type}" STREQUAL "SHARED")
-
set(output_dir "${CMAKE_INSTALL_BINDIR}")
-
endif()
-
@@ -2271,15 +2271,15 @@ function(llvm_setup_rpath name)
-
-
if (APPLE)
-
set(_install_name_dir INSTALL_NAME_DIR "@rpath")
-
- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS)
-
# $ORIGIN is not interpreted at link time by aix ld.
-
# Since BUILD_SHARED_LIBS is only recommended for use by developers,
-
# hardcode the rpath to build/install lib dir first in this mode.
-
# FIXME: update this when there is better solution.
-
- set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
elseif(UNIX)
-
- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
-
set_property(TARGET ${name} APPEND_STRING PROPERTY
-
LINK_FLAGS " -Wl,-z,origin ")
-
diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
-
index 891c9e6d618c..8d963f3b0069 100644
-
--- a/cmake/modules/AddOCaml.cmake
-
+++ b/cmake/modules/AddOCaml.cmake
-
@@ -147,9 +147,9 @@ function(add_ocaml_library name)
-
endforeach()
-
-
if( APPLE )
-
- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
elseif( UNIX )
-
- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
endif()
-
list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}")
-
-
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
-
index d4b0ab959148..26ed981fd09f 100644
-
--- a/cmake/modules/CMakeLists.txt
-
+++ b/cmake/modules/CMakeLists.txt
-
@@ -128,7 +128,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS
-
)
-
list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS)
-
-
-extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}")
-
+extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}")
-
set(LLVM_CONFIG_LIBRARY_DIRS
-
"${LLVM_CONFIG_LIBRARY_DIR}"
-
# FIXME: Should there be other entries here?
-
diff --git a/docs/CMake.rst b/docs/CMake.rst
-
index 879b7b231d4c..9c31d14e8950 100644
-
--- a/docs/CMake.rst
-
+++ b/docs/CMake.rst
-
@@ -250,7 +250,7 @@ description is in `LLVM-related variables`_ below.
-
**LLVM_LIBDIR_SUFFIX**:STRING
-
Extra suffix to append to the directory where libraries are to be
-
installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
-
- to install libraries to ``/usr/lib64``.
-
+ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``.
-
-
**LLVM_PARALLEL_{COMPILE,LINK}_JOBS**:STRING
-
Building the llvm toolchain can use a lot of resources, particularly
-
@@ -284,6 +284,10 @@ manual, or execute ``cmake --help-variable VARIABLE_NAME``.
-
The path to install executables, relative to the *CMAKE_INSTALL_PREFIX*.
-
Defaults to "bin".
-
-
+**CMAKE_INSTALL_LIBDIR**:PATH
-
+ The path to install libraries, relative to the *CMAKE_INSTALL_PREFIX*.
-
+ Defaults to "lib".
-
+
-
**CMAKE_INSTALL_INCLUDEDIR**:PATH
-
The path to install header files, relative to the *CMAKE_INSTALL_PREFIX*.
-
Defaults to "include".
-
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-
index 370005cd8d7d..7e790bc52111 100644
-
--- a/tools/llvm-config/BuildVariables.inc.in
-
+++ b/tools/llvm-config/BuildVariables.inc.in
-
@@ -23,6 +23,7 @@
-
#define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
-
#define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
-
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
-
+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@"
-
#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
-
#define LLVM_INSTALL_PACKAGE_DIR "@LLVM_INSTALL_PACKAGE_DIR@"
-
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
-
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-
index 2c6c55f89d38..f6d2068a0827 100644
-
--- a/tools/llvm-config/llvm-config.cpp
-
+++ b/tools/llvm-config/llvm-config.cpp
-
@@ -369,7 +369,11 @@ int main(int argc, char **argv) {
-
sys::fs::make_absolute(ActivePrefix, Path);
-
ActiveBinDir = std::string(Path.str());
-
}
-
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
-
+ {
-
+ SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX);
-
+ sys::fs::make_absolute(ActivePrefix, Path);
-
+ ActiveLibDir = std::string(Path.str());
-
+ }
-
{
-
SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR);
-
sys::fs::make_absolute(ActivePrefix, Path);
-26
pkgs/development/compilers/llvm/15/llvm/lit-shell-script-runner-set-dyld-library-path.patch
···
-
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py
-
index 0242e0b75af3..d732011306f7 100644
-
--- a/utils/lit/lit/TestRunner.py
-
+++ b/utils/lit/lit/TestRunner.py
-
@@ -1029,6 +1029,12 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
-
f.write('@echo off\n')
-
f.write('\n@if %ERRORLEVEL% NEQ 0 EXIT\n'.join(commands))
-
else:
-
+ # This env var is *purged* when invoking subprocesses so we have to
-
+ # manually set it from within the bash script in order for the commands
-
+ # in run lines to see this var:
-
+ if "DYLD_LIBRARY_PATH" in test.config.environment:
-
+ f.write(f'export DYLD_LIBRARY_PATH="{test.config.environment["DYLD_LIBRARY_PATH"]}"\n')
-
+
-
for i, ln in enumerate(commands):
-
match = re.match(kPdbgRegex, ln)
-
if match:
-
@@ -1363,7 +1369,7 @@ def applySubstitutions(script, substitutions, conditions={},
-
return processed
-
-
process = processLine if recursion_limit is None else processLineToFixedPoint
-
-
-
+
-
return [unescapePercents(process(ln)) for ln in script]
-
-
-79
pkgs/development/compilers/llvm/15/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch
···
-
diff --git a/test/Unit/lit.cfg.py b/test/Unit/lit.cfg.py
-
index 81e8dc04acea..479ff95681e2 100644
-
--- a/test/Unit/lit.cfg.py
-
+++ b/test/Unit/lit.cfg.py
-
@@ -3,6 +3,7 @@
-
# Configuration file for the 'lit' test runner.
-
-
import os
-
+import platform
-
import subprocess
-
-
import lit.formats
-
@@ -55,3 +56,26 @@ if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
-
# Win32 may use %SYSTEMDRIVE% during file system shell operations, so propogate.
-
if sys.platform == 'win32' and 'SYSTEMDRIVE' in os.environ:
-
config.environment['SYSTEMDRIVE'] = os.environ['SYSTEMDRIVE']
-
+
-
+# Add the LLVM dynamic libs to the platform-specific loader search path env var:
-
+#
-
+# TODO: this is copied from `clang`'s `lit.cfg.py`; should unify..
-
+def find_shlibpath_var():
-
+ if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'SunOS']:
-
+ yield 'LD_LIBRARY_PATH'
-
+ elif platform.system() == 'Darwin':
-
+ yield 'DYLD_LIBRARY_PATH'
-
+ elif platform.system() == 'Windows':
-
+ yield 'PATH'
-
+ elif platform.system() == 'AIX':
-
+ yield 'LIBPATH'
-
+
-
+for shlibpath_var in find_shlibpath_var():
-
+ shlibpath = os.path.pathsep.join(
-
+ (config.shlibdir,
-
+ config.environment.get(shlibpath_var, '')))
-
+ config.environment[shlibpath_var] = shlibpath
-
+ break
-
+else:
-
+ lit_config.warning("unable to inject shared library path on '{}'"
-
+ .format(platform.system()))
-
diff --git a/test/lit.cfg.py b/test/lit.cfg.py
-
index 75a38b4c5dad..856fc75c9d74 100644
-
--- a/test/lit.cfg.py
-
+++ b/test/lit.cfg.py
-
@@ -42,6 +42,26 @@ llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
-
llvm_config.with_system_environment(
-
['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP'])
-
-
+# Add the LLVM dynamic libs to the platform-specific loader search path env var:
-
+#
-
+# TODO: this is copied from `clang`'s `lit.cfg.py`; should unify..
-
+def find_shlibpath_var():
-
+ if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'SunOS']:
-
+ yield 'LD_LIBRARY_PATH'
-
+ elif platform.system() == 'Darwin':
-
+ yield 'DYLD_LIBRARY_PATH'
-
+ elif platform.system() == 'Windows':
-
+ yield 'PATH'
-
+ elif platform.system() == 'AIX':
-
+ yield 'LIBPATH'
-
+
-
+for shlibpath_var in find_shlibpath_var():
-
+ shlibpath = config.llvm_shlib_dir
-
+ llvm_config.with_environment(shlibpath_var, shlibpath, append_path = True)
-
+ break
-
+else:
-
+ lit_config.warning("unable to inject shared library path on '{}'"
-
+ .format(platform.system()))
-
-
# Set up OCAMLPATH to include newly built OCaml libraries.
-
top_ocaml_lib = os.path.join(config.llvm_lib_dir, 'ocaml')
-
@@ -318,7 +338,7 @@ def have_cxx_shared_library():
-
-
try:
-
readobj_cmd = subprocess.Popen(
-
- [readobj_exe, '--needed-libs', readobj_exe], stdout=subprocess.PIPE)
-
+ [readobj_exe, '--needed-libs', readobj_exe], stdout=subprocess.PIPE, env=config.environment)
-
except OSError:
-
print('could not exec llvm-readobj')
-
return False
pkgs/development/compilers/llvm/15/llvm/polly-lit-cfg-add-libs-to-dylib-path.patch pkgs/development/compilers/llvm/18/llvm/polly-lit-cfg-add-libs-to-dylib-path.patch
-18
pkgs/development/compilers/llvm/15/openmp/fix-find-tool.patch
···
-
diff --git a/libomptarget/DeviceRTL/CMakeLists.txt b/libomptarget/DeviceRTL/CMakeLists.txt
-
index ce66214822a2..6ab7b33c95da 100644
-
--- a/libomptarget/DeviceRTL/CMakeLists.txt
-
+++ b/libomptarget/DeviceRTL/CMakeLists.txt
-
@@ -27,10 +27,10 @@ endif()
-
if (LLVM_DIR)
-
# Builds that use pre-installed LLVM have LLVM_DIR set.
-
# A standalone or LLVM_ENABLE_RUNTIMES=openmp build takes this route
-
- find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
-
+ find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR})
-
find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR}
-
- NO_DEFAULT_PATH)
-
- find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
-
+ )
-
+ find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR})
-
if ((NOT CLANG_TOOL) OR (NOT LINK_TOOL) OR (NOT OPT_TOOL))
-
libomptarget_say("Not building DeviceRTL. Missing clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL} or opt: ${OPT_TOOL}")
-
return()
-22
pkgs/development/compilers/llvm/15/openmp/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index b6ddbe90516d..311ab1d50e7f 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -29,7 +29,7 @@ if (OPENMP_STANDALONE_BUILD)
-
set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING
-
"Suffix of lib installation directory, e.g. 64 => lib64")
-
# Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR.
-
- set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}")
-
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}")
-
-
# Group test settings.
-
set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
-
@@ -40,7 +40,7 @@ if (OPENMP_STANDALONE_BUILD)
-
else()
-
set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
-
# If building in tree, we honor the same install suffix LLVM uses.
-
- set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
-
if (NOT MSVC)
-
set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
-109
pkgs/development/compilers/llvm/16/clang/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 090cfa352078..624b7c9f3400 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -38,12 +38,26 @@ if(CLANG_BUILT_STANDALONE)
-
find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}")
-
list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
-
-
- # Turn into CACHE PATHs for overwritting
-
- set(LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
-
- set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}" CACHE PATH "Path to LLVM build tree")
-
- set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree")
-
- set(LLVM_TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}" CACHE PATH "Path to llvm/bin")
-
- set(LLVM_LIBRARY_DIR "${LLVM_LIBRARY_DIR}" CACHE PATH "Path to llvm/lib")
-
+ # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets
-
+ # LLVM_CONFIG.
-
+ if (NOT LLVM_CONFIG_FOUND)
-
+ # Pull values from LLVMConfig.cmake. We can drop this once the llvm-config
-
+ # path is removed.
-
+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
-
+ set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
-
+ # N.B. this is just a default value, the CACHE PATHs below can be overriden.
-
+ set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
-
+ set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}")
-
+ set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}")
-
+ else()
-
+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
-
+ endif()
-
+
-
+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
-
+ set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")
-
+ set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree")
-
+ set(LLVM_TOOLS_BINARY_DIR "${TOOLS_BINARY_DIR}" CACHE PATH "Path to llvm/bin")
-
+ set(LLVM_LIBRARY_DIR "${LIBRARY_DIR}" CACHE PATH "Path to llvm/lib")
-
-
find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
-
NO_DEFAULT_PATH)
-
diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake
-
index 75b0080f6715..c895b884cd27 100644
-
--- a/cmake/modules/AddClang.cmake
-
+++ b/cmake/modules/AddClang.cmake
-
@@ -119,8 +119,8 @@ macro(add_clang_library name)
-
install(TARGETS ${lib}
-
COMPONENT ${lib}
-
${export_to_clangtargets}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-
-
if (NOT LLVM_ENABLE_IDE)
-
diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
-
index bb9a11eabbef..e2de91c65fbb 100644
-
--- a/lib/Headers/CMakeLists.txt
-
+++ b/lib/Headers/CMakeLists.txt
-
@@ -437,7 +437,7 @@ add_header_target("openmp-resource-headers" ${openmp_wrapper_files})
-
add_header_target("windows-resource-headers" ${windows_only_files})
-
add_header_target("utility-resource-headers" ${utility_files})
-
-
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION_MAJOR}/include)
-
+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION_MAJOR}/include)
-
-
#############################################################
-
# Install rules for the catch-all clang-resource-headers target
-
diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
-
index 4f23065a2472..6a0f55991e24 100644
-
--- a/tools/libclang/CMakeLists.txt
-
+++ b/tools/libclang/CMakeLists.txt
-
@@ -234,7 +234,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS})
-
COMPONENT
-
libclang-python-bindings
-
DESTINATION
-
- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
-
+ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
-
endforeach()
-
if(NOT LLVM_ENABLE_IDE)
-
add_custom_target(libclang-python-bindings)
-
diff --git a/tools/scan-build-py/CMakeLists.txt b/tools/scan-build-py/CMakeLists.txt
-
index 3aca22c0b0a8..3115353e3fe3 100644
-
--- a/tools/scan-build-py/CMakeLists.txt
-
+++ b/tools/scan-build-py/CMakeLists.txt
-
@@ -88,7 +88,7 @@ foreach(lib ${LibScanbuild})
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib})
-
install(FILES lib/libscanbuild/${lib}
-
- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild
-
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild"
-
COMPONENT scan-build-py)
-
endforeach()
-
-
@@ -106,7 +106,7 @@ foreach(resource ${LibScanbuildResources})
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource})
-
install(FILES lib/libscanbuild/resources/${resource}
-
- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild/resources
-
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild/resources"
-
COMPONENT scan-build-py)
-
endforeach()
-
-
@@ -122,7 +122,7 @@ foreach(lib ${LibEar})
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib})
-
install(FILES lib/libear/${lib}
-
- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libear
-
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libear"
-
COMPONENT scan-build-py)
-
endforeach()
-
-11
pkgs/development/compilers/llvm/16/compiler-rt/asan-offset.patch
···
-
--- a/lib/asan/CMakeLists.txt 2022-06-22 16:46:24.000000000 +0000
-
+++ b/lib/asan/CMakeLists.txt
-
@@ -46,7 +46,7 @@ set(ASAN_STATIC_SOURCES
-
asan_rtl_static.cpp
-
)
-
-
-if (NOT WIN32 AND NOT APPLE)
-
+if (LINUX)
-
list(APPEND ASAN_STATIC_SOURCES
-
asan_rtl_x86_64.S
-
)
-21
pkgs/development/compilers/llvm/16/compiler-rt/freebsd-i386.patch
···
-
--- a/lib/builtins/fp_lib.h 1969-12-31 16:00:01.000000000 -0800
-
+++ b/lib/builtins/fp_lib.h 2023-12-21 23:39:36.066927293 -0800
-
@@ -26,18 +26,6 @@
-
#include <stdbool.h>
-
#include <stdint.h>
-
-
-// x86_64 FreeBSD prior v9.3 define fixed-width types incorrectly in
-
-// 32-bit mode.
-
-#if defined(__FreeBSD__) && defined(__i386__)
-
-#include <sys/param.h>
-
-#if __FreeBSD_version < 903000 // v9.3
-
-#define uint64_t unsigned long long
-
-#define int64_t long long
-
-#undef UINT64_C
-
-#define UINT64_C(c) (c##ULL)
-
-#endif
-
-#endif
-
-
-
#if defined SINGLE_PRECISION
-
-
typedef uint16_t half_rep_t;
pkgs/development/compilers/llvm/16/compiler-rt/normalize-var.patch pkgs/development/compilers/llvm/18/compiler-rt/normalize-var.patch
pkgs/development/compilers/llvm/16/libclc/gnu-install-dirs.patch pkgs/development/compilers/llvm/18/libclc/gnu-install-dirs.patch
-190
pkgs/development/compilers/llvm/16/lld/add-table-base.patch
···
-
From 93adcb770b99351b18553089c164fe3ef2119699 Mon Sep 17 00:00:00 2001
-
From: Sam Clegg <sbc@chromium.org>
-
Date: Fri, 25 Aug 2023 13:56:16 -0700
-
Subject: [PATCH] [lld][WebAssembly] Add `--table-base` setting
-
-
This is similar to `--global-base` but determines where to place the
-
table segments rather than that data segments.
-
-
See https://github.com/emscripten-core/emscripten/issues/20097
-
-
Differential Revision: https://reviews.llvm.org/D158892
-
---
-
test/wasm/table-base.s | 72 ++++++++++++++++++++++++++++++++++++++
-
wasm/Driver.cpp | 19 ++++++++--
-
wasm/Options.td | 5 ++-
-
wasm/Writer.cpp | 8 -----
-
4 files changed, 93 insertions(+), 11 deletions(-)
-
create mode 100644 test/wasm/table-base.s
-
-
diff --git a/test/wasm/table-base.s b/test/wasm/table-base.s
-
new file mode 100644
-
index 000000000000000..56fff414fd31d96
-
--- /dev/null
-
+++ b/test/wasm/table-base.s
-
@@ -0,0 +1,72 @@
-
+# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o
-
+
-
+# RUN: wasm-ld --export=__table_base -o %t.wasm %t.o
-
+# RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=CHECK-DEFAULT
-
+
-
+# RUN: wasm-ld --table-base=100 --export=__table_base -o %t.wasm %t.o
-
+# RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=CHECK-100
-
+
-
+.globl _start
-
+_start:
-
+ .functype _start () -> ()
-
+ i32.const _start
-
+ drop
-
+ end_function
-
+
-
+# CHECK-DEFAULT: - Type: TABLE
-
+# CHECK-DEFAULT-NEXT: Tables:
-
+# CHECK-DEFAULT-NEXT: - Index: 0
-
+# CHECK-DEFAULT-NEXT: ElemType: FUNCREF
-
+# CHECK-DEFAULT-NEXT: Limits:
-
+# CHECK-DEFAULT-NEXT: Flags: [ HAS_MAX ]
-
+# CHECK-DEFAULT-NEXT: Minimum: 0x2
-
+# CHECK-DEFAULT-NEXT: Maximum: 0x2
-
+
-
+# CHECK-DEFAULT: - Type: GLOBAL
-
+# CHECK-DEFAULT-NEXT: Globals:
-
+# CHECK-DEFAULT-NEXT: - Index: 0
-
+# CHECK-DEFAULT-NEXT: Type: I32
-
+# CHECK-DEFAULT-NEXT: Mutable: true
-
+# CHECK-DEFAULT-NEXT: InitExpr:
-
+# CHECK-DEFAULT-NEXT: Opcode: I32_CONST
-
+# CHECK-DEFAULT-NEXT: Value: 66560
-
+# CHECK-DEFAULT-NEXT: - Index: 1
-
+# CHECK-DEFAULT-NEXT: Type: I32
-
+# CHECK-DEFAULT-NEXT: Mutable: false
-
+# CHECK-DEFAULT-NEXT: InitExpr:
-
+# CHECK-DEFAULT-NEXT: Opcode: I32_CONST
-
+# CHECK-DEFAULT-NEXT: Value: 1
-
+
-
+# CHECK-DEFAULT: - Type: EXPORT
-
+# CHECK-DEFAULT: - Name: __table_base
-
+# CHECK-DEFAULT-NEXT: Kind: GLOBAL
-
+# CHECK-DEFAULT-NEXT: Index: 1
-
+
-
+# CHECK-100: - Type: TABLE
-
+# CHECK-100-NEXT: Tables:
-
+# CHECK-100-NEXT: - Index: 0
-
+# CHECK-100-NEXT: ElemType: FUNCREF
-
+# CHECK-100-NEXT: Limits:
-
+# CHECK-100-NEXT: Flags: [ HAS_MAX ]
-
+# CHECK-100-NEXT: Minimum: 0x65
-
+# CHECK-100-NEXT: Maximum: 0x65
-
+
-
+# CHECK-100: - Type: GLOBAL
-
+# CHECK-100-NEXT: Globals:
-
+# CHECK-100-NEXT: - Index: 0
-
+# CHECK-100-NEXT: Type: I32
-
+# CHECK-100-NEXT: Mutable: true
-
+# CHECK-100-NEXT: InitExpr:
-
+# CHECK-100-NEXT: Opcode: I32_CONST
-
+# CHECK-100-NEXT: Value: 66560
-
+# CHECK-100-NEXT: - Index: 1
-
+# CHECK-100-NEXT: Type: I32
-
+# CHECK-100-NEXT: Mutable: false
-
+# CHECK-100-NEXT: InitExpr:
-
+# CHECK-100-NEXT: Opcode: I32_CONST
-
+# CHECK-100-NEXT: Value: 100
-
+
-
+# CHECK-100: - Type: EXPORT
-
+# CHECK-100: - Name: __table_base
-
+# CHECK-100-NEXT: Kind: GLOBAL
-
+# CHECK-100-NEXT: Index: 1
-
diff --git a/wasm/Driver.cpp b/wasm/Driver.cpp
-
index 84304881f5ca34e..c2f5f0185781f36 100644
-
--- a/wasm/Driver.cpp
-
+++ b/wasm/Driver.cpp
-
@@ -502,6 +502,7 @@ static void readConfigs(opt::InputArgList &args) {
-
-
config->initialMemory = args::getInteger(args, OPT_initial_memory, 0);
-
config->globalBase = args::getInteger(args, OPT_global_base, 0);
-
+ config->tableBase = args::getInteger(args, OPT_table_base, 0);
-
config->maxMemory = args::getInteger(args, OPT_max_memory, 0);
-
config->zStackSize =
-
args::getZOptionValue(args, OPT_z, "stack-size", WasmPageSize);
-
@@ -573,6 +574,17 @@ static void setConfigs() {
-
if (config->exportTable)
-
error("-shared/-pie is incompatible with --export-table");
-
config->importTable = true;
-
+ } else {
-
+ // Default table base. Defaults to 1, reserving 0 for the NULL function
-
+ // pointer.
-
+ if (!config->tableBase)
-
+ config->tableBase = 1;
-
+ // The default offset for static/global data, for when --global-base is
-
+ // not specified on the command line. The precise value of 1024 is
-
+ // somewhat arbitrary, and pre-dates wasm-ld (Its the value that
-
+ // emscripten used prior to wasm-ld).
-
+ if (!config->globalBase && !config->relocatable && !config->stackFirst)
-
+ config->globalBase = 1024;
-
}
-
-
if (config->relocatable) {
-
@@ -666,8 +678,11 @@ static void checkOptions(opt::InputArgList &args) {
-
warn("-Bsymbolic is only meaningful when combined with -shared");
-
}
-
-
- if (config->globalBase && config->isPic) {
-
- error("--global-base may not be used with -shared/-pie");
-
+ if (config->isPic) {
-
+ if (config->globalBase)
-
+ error("--global-base may not be used with -shared/-pie");
-
+ if (config->tableBase)
-
+ error("--table-base may not be used with -shared/-pie");
-
}
-
}
-
-
diff --git a/wasm/Options.td b/wasm/Options.td
-
index 50417d2928e0a34..bb764396bf4df14 100644
-
--- a/wasm/Options.td
-
+++ b/wasm/Options.td
-
@@ -191,7 +191,7 @@ def growable_table: FF<"growable-table">,
-
HelpText<"Remove maximum size from function table, allowing table to grow">;
-
-
def global_base: JJ<"global-base=">,
-
- HelpText<"Where to start to place global data">;
-
+ HelpText<"Memory offset at which to place global data (Defaults to 1024)">;
-
-
def import_memory: FF<"import-memory">,
-
HelpText<"Import the module's memory from the default module of \"env\" with the name \"memory\".">;
-
@@ -224,6 +224,9 @@ def no_entry: FF<"no-entry">,
-
def stack_first: FF<"stack-first">,
-
HelpText<"Place stack at start of linear memory rather than after data">;
-
-
+def table_base: JJ<"table-base=">,
-
+ HelpText<"Table offset at which to place address taken functions (Defaults to 1)">;
-
+
-
defm whole_archive: B<"whole-archive",
-
"Force load of all members in a static library",
-
"Do not force load of all members in a static library (default)">;
-
diff --git a/wasm/Writer.cpp b/wasm/Writer.cpp
-
index f25d358dc5bae6f..0576bf2907e49c4 100644
-
--- a/wasm/Writer.cpp
-
+++ b/wasm/Writer.cpp
-
@@ -358,13 +358,6 @@ void Writer::layoutMemory() {
-
memoryPtr = config->globalBase;
-
}
-
} else {
-
- if (!config->globalBase && !config->relocatable && !config->isPic) {
-
- // The default offset for static/global data, for when --global-base is
-
- // not specified on the command line. The precise value of 1024 is
-
- // somewhat arbitrary, and pre-dates wasm-ld (Its the value that
-
- // emscripten used prior to wasm-ld).
-
- config->globalBase = 1024;
-
- }
-
memoryPtr = config->globalBase;
-
}
-
-
@@ -1685,7 +1678,6 @@ void Writer::run() {
-
// For PIC code the table base is assigned dynamically by the loader.
-
// For non-PIC, we start at 1 so that accessing table index 0 always traps.
-
if (!config->isPic) {
-
- config->tableBase = 1;
-
if (WasmSym::definedTableBase)
-
WasmSym::definedTableBase->setVA(config->tableBase);
-
if (WasmSym::definedTableBase32)
-46
pkgs/development/compilers/llvm/16/lld/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 3d6225646fe6..9b5d0b15af13 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -33,10 +33,22 @@ if(LLD_BUILT_STANDALONE)
-
find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}")
-
list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
-
-
- # Turn into CACHE PATHs for overwriting
-
- set(LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
-
- set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}" CACHE PATH "Path to LLVM build tree")
-
- set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree")
-
+ # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets
-
+ # LLVM_CONFIG.
-
+ if (NOT LLVM_CONFIG_FOUND)
-
+ # Pull values from LLVMConfig.cmake. We can drop this once the llvm-config
-
+ # path is removed.
-
+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
-
+ set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
-
+ # N.B. this is just a default value, the CACHE PATHs below can be overridden.
-
+ set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
-
+ else()
-
+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
-
+ endif()
-
+
-
+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
-
+ set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")
-
+ set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree")
-
-
find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
-
NO_DEFAULT_PATH)
-
diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake
-
index d3924f7243d4..42a7cd62281c 100644
-
--- a/cmake/modules/AddLLD.cmake
-
+++ b/cmake/modules/AddLLD.cmake
-
@@ -18,8 +18,8 @@ macro(add_lld_library name)
-
install(TARGETS ${name}
-
COMPONENT ${name}
-
${export_to_lldtargets}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-
-
if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
-14
pkgs/development/compilers/llvm/16/lldb/resource-dir.patch
···
-
diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake
-
index ec06ba285f27..286162f098fb 100644
-
--- a/cmake/modules/LLDBConfig.cmake
-
+++ b/cmake/modules/LLDBConfig.cmake
-
@@ -290,7 +290,8 @@ if (NOT TARGET clang-resource-headers)
-
# could be and pick the first that exists.
-
foreach(CANDIDATE "${Clang_DIR}/../.." "${LLVM_DIR}" "${LLVM_LIBRARY_DIRS}"
-
"${LLVM_BUILD_LIBRARY_DIR}"
-
- "${LLVM_LIBRARY_DIR}")
-
+ "${LLVM_LIBRARY_DIR}"
-
+ "@clangLibDir@")
-
# Build the resource directory path by appending 'clang/<version number>'.
-
set(CANDIDATE_RESOURCE_DIR "${CANDIDATE}/clang/${LLDB_CLANG_RESOURCE_DIR_NAME}")
-
if (IS_DIRECTORY "${CANDIDATE_RESOURCE_DIR}")
-161
pkgs/development/compilers/llvm/16/llvm/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 7e25e0407db2..72f031a82b75 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -995,7 +995,7 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "")
-
add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src
-
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime)
-
install(TARGETS tf_xla_runtime EXPORT LLVMExports
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
-
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
-
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime)
-
# Once we add more modules, we should handle this more automatically.
-
if (DEFINED LLVM_OVERRIDE_MODEL_HEADER_INLINERSIZEMODEL)
-
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
-
index 93e6d67551de..8d367457af5a 100644
-
--- a/cmake/modules/AddLLVM.cmake
-
+++ b/cmake/modules/AddLLVM.cmake
-
@@ -874,8 +874,8 @@ macro(add_llvm_library name)
-
get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella})
-
install(TARGETS ${name}
-
${export_to_llvmexports}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name})
-
-
if (NOT LLVM_ENABLE_IDE)
-
@@ -2043,7 +2043,7 @@ function(llvm_install_library_symlink name dest type)
-
set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX})
-
set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX})
-
-
- set(output_dir lib${LLVM_LIBDIR_SUFFIX})
-
+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
if(WIN32 AND "${type}" STREQUAL "SHARED")
-
set(output_dir "${CMAKE_INSTALL_BINDIR}")
-
endif()
-
@@ -2312,16 +2312,37 @@ function(llvm_setup_rpath name)
-
-
if (APPLE)
-
set(_install_name_dir INSTALL_NAME_DIR "@rpath")
-
- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS)
-
# $ORIGIN is not interpreted at link time by aix ld.
-
# Since BUILD_SHARED_LIBS is only recommended for use by developers,
-
# hardcode the rpath to build/install lib dir first in this mode.
-
# FIXME: update this when there is better solution.
-
- set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
elseif(UNIX)
-
- set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
-
+ # Note that we add `extra_libdir` (aka `LLVM_LIBRARY_DIR` in our case) back
-
+ # to `_install_rpath` here.
-
+ #
-
+ # In nixpkgs we do not build and install LLVM alongside rdeps of LLVM (i.e.
-
+ # clang); instead LLVM is its own package and thus lands at its own nix
-
+ # store path. This makes it so that the default relative rpath (`../lib/`)
-
+ # does not point at the LLVM shared objects.
-
+ #
-
+ # More discussion here:
-
+ # - https://github.com/NixOS/nixpkgs/pull/235624#discussion_r1220150329
-
+ # - https://reviews.llvm.org/D146918 (16.0.5+)
-
+ #
-
+ # Note that we leave `extra_libdir` in `_build_rpath`: without FHS there is
-
+ # no potential that this will result in us pulling in the "wrong" LLVM.
-
+ # Adding this to the build rpath means we aren't forced to use
-
+ # `installCheckPhase` instead of `checkPhase` (i.e. binaries in the build
-
+ # dir, pre-install, will have the right rpath for LLVM).
-
+ #
-
+ # As noted in the differential above, an alternative solution is to have
-
+ # all rdeps of nixpkgs' LLVM (that use the AddLLVM.cmake machinery) set
-
+ # `CMAKE_INSTALL_RPATH`.
-
+ set(_build_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
-
set_property(TARGET ${name} APPEND_STRING PROPERTY
-
LINK_FLAGS " -Wl,-z,origin ")
-
diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
-
index 891c9e6d618c..8d963f3b0069 100644
-
--- a/cmake/modules/AddOCaml.cmake
-
+++ b/cmake/modules/AddOCaml.cmake
-
@@ -147,9 +147,9 @@ function(add_ocaml_library name)
-
endforeach()
-
-
if( APPLE )
-
- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
elseif( UNIX )
-
- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
endif()
-
list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}")
-
-
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
-
index d99af79aa38e..21e794224b99 100644
-
--- a/cmake/modules/CMakeLists.txt
-
+++ b/cmake/modules/CMakeLists.txt
-
@@ -127,7 +127,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS
-
)
-
list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS)
-
-
-extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}")
-
+extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}")
-
set(LLVM_CONFIG_LIBRARY_DIRS
-
"${LLVM_CONFIG_LIBRARY_DIR}"
-
# FIXME: Should there be other entries here?
-
diff --git a/docs/CMake.rst b/docs/CMake.rst
-
index 7926de258ec8..5ae01adc3905 100644
-
--- a/docs/CMake.rst
-
+++ b/docs/CMake.rst
-
@@ -250,7 +250,7 @@ description is in `LLVM-related variables`_ below.
-
**LLVM_LIBDIR_SUFFIX**:STRING
-
Extra suffix to append to the directory where libraries are to be
-
installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
-
- to install libraries to ``/usr/lib64``.
-
+ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``.
-
-
**LLVM_PARALLEL_{COMPILE,LINK}_JOBS**:STRING
-
Building the llvm toolchain can use a lot of resources, particularly
-
@@ -284,6 +284,10 @@ manual, or execute ``cmake --help-variable VARIABLE_NAME``.
-
The path to install executables, relative to the *CMAKE_INSTALL_PREFIX*.
-
Defaults to "bin".
-
-
+**CMAKE_INSTALL_LIBDIR**:PATH
-
+ The path to install libraries, relative to the *CMAKE_INSTALL_PREFIX*.
-
+ Defaults to "lib".
-
+
-
**CMAKE_INSTALL_INCLUDEDIR**:PATH
-
The path to install header files, relative to the *CMAKE_INSTALL_PREFIX*.
-
Defaults to "include".
-
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-
index 370005cd8d7d..7e790bc52111 100644
-
--- a/tools/llvm-config/BuildVariables.inc.in
-
+++ b/tools/llvm-config/BuildVariables.inc.in
-
@@ -23,6 +23,7 @@
-
#define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
-
#define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
-
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
-
+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@"
-
#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
-
#define LLVM_INSTALL_PACKAGE_DIR "@LLVM_INSTALL_PACKAGE_DIR@"
-
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
-
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-
index b1d795a0a349..de6cb1514f05 100644
-
--- a/tools/llvm-config/llvm-config.cpp
-
+++ b/tools/llvm-config/llvm-config.cpp
-
@@ -366,7 +366,11 @@ int main(int argc, char **argv) {
-
sys::fs::make_absolute(ActivePrefix, Path);
-
ActiveBinDir = std::string(Path.str());
-
}
-
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
-
+ {
-
+ SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX);
-
+ sys::fs::make_absolute(ActivePrefix, Path);
-
+ ActiveLibDir = std::string(Path.str());
-
+ }
-
{
-
SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR);
-
sys::fs::make_absolute(ActivePrefix, Path);
-17
pkgs/development/compilers/llvm/16/llvm/lit-shell-script-runner-set-dyld-library-path.patch
···
-
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py
-
index 0242e0b75af3..d732011306f7 100644
-
--- a/utils/lit/lit/TestRunner.py
-
+++ b/utils/lit/lit/TestRunner.py
-
@@ -1029,6 +1029,12 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
-
f.write('@echo off\n')
-
f.write('\n@if %ERRORLEVEL% NEQ 0 EXIT\n'.join(commands))
-
else:
-
+ # This env var is *purged* when invoking subprocesses so we have to
-
+ # manually set it from within the bash script in order for the commands
-
+ # in run lines to see this var:
-
+ if "DYLD_LIBRARY_PATH" in test.config.environment:
-
+ f.write(f'export DYLD_LIBRARY_PATH="{test.config.environment["DYLD_LIBRARY_PATH"]}"\n')
-
+
-
for i, ln in enumerate(commands):
-
match = re.match(kPdbgRegex, ln)
-
if match:
-79
pkgs/development/compilers/llvm/16/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch
···
-
diff --git a/test/Unit/lit.cfg.py b/test/Unit/lit.cfg.py
-
index 81e8dc04acea..479ff95681e2 100644
-
--- a/test/Unit/lit.cfg.py
-
+++ b/test/Unit/lit.cfg.py
-
@@ -3,6 +3,7 @@
-
# Configuration file for the 'lit' test runner.
-
-
import os
-
+import platform
-
import subprocess
-
-
import lit.formats
-
@@ -55,3 +56,26 @@ if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
-
# Win32 may use %SYSTEMDRIVE% during file system shell operations, so propogate.
-
if sys.platform == 'win32' and 'SYSTEMDRIVE' in os.environ:
-
config.environment['SYSTEMDRIVE'] = os.environ['SYSTEMDRIVE']
-
+
-
+# Add the LLVM dynamic libs to the platform-specific loader search path env var:
-
+#
-
+# TODO: this is copied from `clang`'s `lit.cfg.py`; should unify..
-
+def find_shlibpath_var():
-
+ if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'SunOS']:
-
+ yield 'LD_LIBRARY_PATH'
-
+ elif platform.system() == 'Darwin':
-
+ yield 'DYLD_LIBRARY_PATH'
-
+ elif platform.system() == 'Windows':
-
+ yield 'PATH'
-
+ elif platform.system() == 'AIX':
-
+ yield 'LIBPATH'
-
+
-
+for shlibpath_var in find_shlibpath_var():
-
+ shlibpath = os.path.pathsep.join(
-
+ (config.shlibdir,
-
+ config.environment.get(shlibpath_var, '')))
-
+ config.environment[shlibpath_var] = shlibpath
-
+ break
-
+else:
-
+ lit_config.warning("unable to inject shared library path on '{}'"
-
+ .format(platform.system()))
-
diff --git a/test/lit.cfg.py b/test/lit.cfg.py
-
index 75a38b4c5dad..856fc75c9d74 100644
-
--- a/test/lit.cfg.py
-
+++ b/test/lit.cfg.py
-
@@ -42,6 +42,26 @@ llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
-
llvm_config.with_system_environment(
-
['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP'])
-
-
+# Add the LLVM dynamic libs to the platform-specific loader search path env var:
-
+#
-
+# TODO: this is copied from `clang`'s `lit.cfg.py`; should unify..
-
+def find_shlibpath_var():
-
+ if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'SunOS']:
-
+ yield 'LD_LIBRARY_PATH'
-
+ elif platform.system() == 'Darwin':
-
+ yield 'DYLD_LIBRARY_PATH'
-
+ elif platform.system() == 'Windows':
-
+ yield 'PATH'
-
+ elif platform.system() == 'AIX':
-
+ yield 'LIBPATH'
-
+
-
+for shlibpath_var in find_shlibpath_var():
-
+ shlibpath = config.llvm_shlib_dir
-
+ llvm_config.with_environment(shlibpath_var, shlibpath, append_path = True)
-
+ break
-
+else:
-
+ lit_config.warning("unable to inject shared library path on '{}'"
-
+ .format(platform.system()))
-
-
# Set up OCAMLPATH to include newly built OCaml libraries.
-
top_ocaml_lib = os.path.join(config.llvm_lib_dir, 'ocaml')
-
@@ -318,7 +338,7 @@ def have_cxx_shared_library():
-
-
try:
-
readobj_cmd = subprocess.Popen(
-
- [readobj_exe, '--needed-libs', readobj_exe], stdout=subprocess.PIPE)
-
+ [readobj_exe, '--needed-libs', readobj_exe], stdout=subprocess.PIPE, env=config.environment)
-
except OSError:
-
print('could not exec llvm-readobj')
-
return False
-21
pkgs/development/compilers/llvm/16/openmp/fix-find-tool.patch
···
-
diff --git a/libomptarget/DeviceRTL/CMakeLists.txt b/libomptarget/DeviceRTL/CMakeLists.txt
-
index 49b398c9f765..6f1dd1340010 100644
-
--- a/libomptarget/DeviceRTL/CMakeLists.txt
-
+++ b/libomptarget/DeviceRTL/CMakeLists.txt
-
@@ -27,11 +27,11 @@ endif()
-
if (LLVM_DIR)
-
# Builds that use pre-installed LLVM have LLVM_DIR set.
-
# A standalone or LLVM_ENABLE_RUNTIMES=openmp build takes this route
-
- find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
-
- find_program(PACKAGER_TOOL clang-offload-packager PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
-
- find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
-
- find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
-
- find_program(EXTRACT_TOOL llvm-extract PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
-
+ find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR})
-
+ find_program(PACKAGER_TOOL clang-offload-packager PATHS ${LLVM_TOOLS_BINARY_DIR})
-
+ find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR})
-
+ find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR})
-
+ find_program(EXTRACT_TOOL llvm-extract PATHS ${LLVM_TOOLS_BINARY_DIR})
-
if ((NOT CLANG_TOOL) OR (NOT LINK_TOOL) OR (NOT OPT_TOOL) OR (NOT EXTRACT_TOOL) OR (NOT PACKAGER_TOOL))
-
libomptarget_say("Not building DeviceRTL. Missing clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL}, opt: ${OPT_TOOL}, llvm-extract: ${EXTRACT_TOOL}, or clang-offload-packager: ${PACKAGER_TOOL}")
-
return()
-22
pkgs/development/compilers/llvm/16/openmp/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index b6ddbe90516d..311ab1d50e7f 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -29,7 +29,7 @@ if (OPENMP_STANDALONE_BUILD)
-
set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING
-
"Suffix of lib installation directory, e.g. 64 => lib64")
-
# Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR.
-
- set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}")
-
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}")
-
-
# Group test settings.
-
set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
-
@@ -40,7 +40,7 @@ if (OPENMP_STANDALONE_BUILD)
-
else()
-
set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
-
# If building in tree, we honor the same install suffix LLVM uses.
-
- set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
-
if (NOT MSVC)
-
set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
pkgs/development/compilers/llvm/16/openmp/run-lit-directly.patch pkgs/development/compilers/llvm/18/openmp/run-lit-directly.patch
-39
pkgs/development/compilers/llvm/17/clang/aarch64-tblgen.patch
···
-
diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def
-
index ef0dad0f2..afd101b00 100644
-
--- a/include/clang/Basic/TokenKinds.def
-
+++ b/include/clang/Basic/TokenKinds.def
-
@@ -753,7 +753,7 @@ KEYWORD(__builtin_sycl_unique_stable_name, KEYSYCL)
-
-
// Keywords defined by Attr.td.
-
#ifndef KEYWORD_ATTRIBUTE
-
-#define KEYWORD_ATTRIBUTE(X) KEYWORD(X, KEYALL)
-
+#define KEYWORD_ATTRIBUTE(X, EMPTY) KEYWORD(EMPTY ## X, KEYALL)
-
#endif
-
#include "clang/Basic/AttrTokenKinds.inc"
-
-
diff --git a/include/clang/Basic/TokenKinds.h b/include/clang/Basic/TokenKinds.h
-
index e4857405b..ff117bd5a 100644
-
--- a/include/clang/Basic/TokenKinds.h
-
+++ b/include/clang/Basic/TokenKinds.h
-
@@ -109,7 +109,7 @@ bool isPragmaAnnotation(TokenKind K);
-
-
inline constexpr bool isRegularKeywordAttribute(TokenKind K) {
-
return (false
-
-#define KEYWORD_ATTRIBUTE(X) || (K == tok::kw_##X)
-
+#define KEYWORD_ATTRIBUTE(X, ...) || (K == tok::kw_##X)
-
#include "clang/Basic/AttrTokenKinds.inc"
-
);
-
}
-
diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp
-
index b5813c6ab..79db17501 100644
-
--- a/utils/TableGen/ClangAttrEmitter.cpp
-
+++ b/utils/TableGen/ClangAttrEmitter.cpp
-
@@ -3430,7 +3430,7 @@ void EmitClangAttrTokenKinds(RecordKeeper &Records, raw_ostream &OS) {
-
"RegularKeyword attributes with arguments are not "
-
"yet supported");
-
OS << "KEYWORD_ATTRIBUTE("
-
- << S.getSpellingRecord().getValueAsString("Name") << ")\n";
-
+ << S.getSpellingRecord().getValueAsString("Name") << ", )\n";
-
}
-
OS << "#undef KEYWORD_ATTRIBUTE\n";
-
}
-98
pkgs/development/compilers/llvm/17/clang/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index f7936d72e088..a362fa49b534 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -31,7 +31,21 @@ if(CLANG_BUILT_STANDALONE)
-
find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}")
-
list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
-
-
- # Turn into CACHE PATHs for overwritting
-
+ # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets
-
+ # LLVM_CONFIG.
-
+ if (NOT LLVM_CONFIG_FOUND)
-
+ # Pull values from LLVMConfig.cmake. We can drop this once the llvm-config
-
+ # path is removed.
-
+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
-
+ set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
-
+ # N.B. this is just a default value, the CACHE PATHs below can be overriden.
-
+ set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
-
+ set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}")
-
+ set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}")
-
+ else()
-
+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
-
+ endif()
-
+
-
set(LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
-
set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}" CACHE PATH "Path to LLVM build tree")
-
set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree")
-
diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake
-
index 75b0080f6715..c895b884cd27 100644
-
--- a/cmake/modules/AddClang.cmake
-
+++ b/cmake/modules/AddClang.cmake
-
@@ -119,8 +119,8 @@ macro(add_clang_library name)
-
install(TARGETS ${lib}
-
COMPONENT ${lib}
-
${export_to_clangtargets}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-
-
if (NOT LLVM_ENABLE_IDE)
-
diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
-
index f2b0c5cddcbb..52f37fc368ce 100644
-
--- a/lib/Headers/CMakeLists.txt
-
+++ b/lib/Headers/CMakeLists.txt
-
@@ -473,6 +473,7 @@ add_header_target("windows-resource-headers" ${windows_only_files})
-
add_header_target("utility-resource-headers" ${utility_files})
-
-
get_clang_resource_dir(header_install_dir SUBDIR include)
-
+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${CLANG_VERSION_MAJOR}/include)
-
-
#############################################################
-
# Install rules for the catch-all clang-resource-headers target
-
diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
-
index 4f23065a2472..6a0f55991e24 100644
-
--- a/tools/libclang/CMakeLists.txt
-
+++ b/tools/libclang/CMakeLists.txt
-
@@ -234,7 +234,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS})
-
COMPONENT
-
libclang-python-bindings
-
DESTINATION
-
- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
-
+ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
-
endforeach()
-
if(NOT LLVM_ENABLE_IDE)
-
add_custom_target(libclang-python-bindings)
-
diff --git a/tools/scan-build-py/CMakeLists.txt b/tools/scan-build-py/CMakeLists.txt
-
index 3aca22c0b0a8..3115353e3fe3 100644
-
--- a/tools/scan-build-py/CMakeLists.txt
-
+++ b/tools/scan-build-py/CMakeLists.txt
-
@@ -88,7 +88,7 @@ foreach(lib ${LibScanbuild})
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib})
-
install(FILES lib/libscanbuild/${lib}
-
- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild
-
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild"
-
COMPONENT scan-build-py)
-
endforeach()
-
-
@@ -106,7 +106,7 @@ foreach(resource ${LibScanbuildResources})
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource})
-
install(FILES lib/libscanbuild/resources/${resource}
-
- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild/resources
-
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild/resources"
-
COMPONENT scan-build-py)
-
endforeach()
-
-
@@ -122,7 +122,7 @@ foreach(lib ${LibEar})
-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib})
-
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib})
-
install(FILES lib/libear/${lib}
-
- DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libear
-
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libear"
-
COMPONENT scan-build-py)
-
endforeach()
-
-29
pkgs/development/compilers/llvm/17/clang/purity.patch
···
-
From 4add81bba40dcec62c4ea4481be8e35ac53e89d8 Mon Sep 17 00:00:00 2001
-
From: Will Dietz <w@wdtz.org>
-
Date: Thu, 18 May 2017 11:56:12 -0500
-
Subject: [PATCH] "purity" patch for 5.0
-
-
---
-
lib/Driver/ToolChains/Gnu.cpp | 7 -------
-
1 file changed, 7 deletions(-)
-
-
diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
-
index fe3c0191bb..c6a482bece 100644
-
--- a/lib/Driver/ToolChains/Gnu.cpp
-
+++ b/lib/Driver/ToolChains/Gnu.cpp
-
@@ -487,13 +487,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
-
} else {
-
if (Args.hasArg(options::OPT_rdynamic))
-
CmdArgs.push_back("-export-dynamic");
-
-
- if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE &&
-
- !Args.hasArg(options::OPT_r)) {
-
- CmdArgs.push_back("-dynamic-linker");
-
- CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) +
-
- ToolChain.getDynamicLinker(Args)));
-
- }
-
}
-
-
CmdArgs.push_back("-o");
-
--
-
2.11.0
-20
pkgs/development/compilers/llvm/17/compiler-rt/gnu-install-dirs.patch
···
-
diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
-
index 8a6219568b3f..30ee68a47ccf 100644
-
--- a/cmake/base-config-ix.cmake
-
+++ b/cmake/base-config-ix.cmake
-
@@ -100,13 +100,13 @@ endif()
-
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-
set(COMPILER_RT_OUTPUT_LIBRARY_DIR
-
${COMPILER_RT_OUTPUT_DIR}/lib)
-
- extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" lib)
-
+ extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}")
-
set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH
-
"Path where built compiler-rt libraries should be installed.")
-
else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-
set(COMPILER_RT_OUTPUT_LIBRARY_DIR
-
${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR})
-
- extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "lib/${COMPILER_RT_OS_DIR}")
-
+ extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}/${COMPILER_RT_OS_DIR}")
-
set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH
-
"Path where built compiler-rt libraries should be installed.")
-
endif()
-46
pkgs/development/compilers/llvm/17/lld/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 3d6225646fe6..9b5d0b15af13 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -33,10 +33,22 @@ if(LLD_BUILT_STANDALONE)
-
find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}")
-
list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
-
-
- # Turn into CACHE PATHs for overwriting
-
- set(LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
-
- set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}" CACHE PATH "Path to LLVM build tree")
-
- set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree")
-
+ # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets
-
+ # LLVM_CONFIG.
-
+ if (NOT LLVM_CONFIG_FOUND)
-
+ # Pull values from LLVMConfig.cmake. We can drop this once the llvm-config
-
+ # path is removed.
-
+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
-
+ set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
-
+ # N.B. this is just a default value, the CACHE PATHs below can be overridden.
-
+ set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
-
+ else()
-
+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
-
+ endif()
-
+
-
+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
-
+ set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")
-
+ set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree")
-
-
find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
-
NO_DEFAULT_PATH)
-
diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake
-
index d3924f7243d4..42a7cd62281c 100644
-
--- a/cmake/modules/AddLLD.cmake
-
+++ b/cmake/modules/AddLLD.cmake
-
@@ -18,8 +18,8 @@ macro(add_lld_library name)
-
install(TARGETS ${name}
-
COMPONENT ${name}
-
${export_to_lldtargets}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-
-
if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
-137
pkgs/development/compilers/llvm/17/llvm/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index 471817d68286..c51463304159 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -1010,7 +1010,7 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "")
-
add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src
-
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime)
-
install(TARGETS tf_xla_runtime EXPORT LLVMExports
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
-
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
-
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime)
-
# Once we add more modules, we should handle this more automatically.
-
if (DEFINED LLVM_OVERRIDE_MODEL_HEADER_INLINERSIZEMODEL)
-
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
-
index 230620c37027..dd16cab1835e 100644
-
--- a/cmake/modules/AddLLVM.cmake
-
+++ b/cmake/modules/AddLLVM.cmake
-
@@ -876,8 +876,8 @@ macro(add_llvm_library name)
-
get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella})
-
install(TARGETS ${name}
-
${export_to_llvmexports}
-
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
-
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
-
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name})
-
-
if (NOT LLVM_ENABLE_IDE)
-
@@ -2069,7 +2069,7 @@ function(llvm_install_library_symlink name dest type)
-
set(LLVM_LINK_OR_COPY copy)
-
endif()
-
-
- set(output_dir lib${LLVM_LIBDIR_SUFFIX})
-
+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-
if(WIN32 AND "${type}" STREQUAL "SHARED")
-
set(output_dir "${CMAKE_INSTALL_BINDIR}")
-
endif()
-
@@ -2344,16 +2344,37 @@ function(llvm_setup_rpath name)
-
-
if (APPLE)
-
set(_install_name_dir INSTALL_NAME_DIR "@rpath")
-
- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS)
-
# $ORIGIN is not interpreted at link time by aix ld.
-
# Since BUILD_SHARED_LIBS is only recommended for use by developers,
-
# hardcode the rpath to build/install lib dir first in this mode.
-
# FIXME: update this when there is better solution.
-
- set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
elseif(UNIX)
-
- set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
-
+ # Note that we add `extra_libdir` (aka `LLVM_LIBRARY_DIR` in our case) back
-
+ # to `_install_rpath` here.
-
+ #
-
+ # In nixpkgs we do not build and install LLVM alongside rdeps of LLVM (i.e.
-
+ # clang); instead LLVM is its own package and thus lands at its own nix
-
+ # store path. This makes it so that the default relative rpath (`../lib/`)
-
+ # does not point at the LLVM shared objects.
-
+ #
-
+ # More discussion here:
-
+ # - https://github.com/NixOS/nixpkgs/pull/235624#discussion_r1220150329
-
+ # - https://reviews.llvm.org/D146918 (16.0.5+)
-
+ #
-
+ # Note that we leave `extra_libdir` in `_build_rpath`: without FHS there is
-
+ # no potential that this will result in us pulling in the "wrong" LLVM.
-
+ # Adding this to the build rpath means we aren't forced to use
-
+ # `installCheckPhase` instead of `checkPhase` (i.e. binaries in the build
-
+ # dir, pre-install, will have the right rpath for LLVM).
-
+ #
-
+ # As noted in the differential above, an alternative solution is to have
-
+ # all rdeps of nixpkgs' LLVM (that use the AddLLVM.cmake machinery) set
-
+ # `CMAKE_INSTALL_RPATH`.
-
+ set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-
+ set(_install_rpath ${extra_libdir})
-
if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
-
set_property(TARGET ${name} APPEND_STRING PROPERTY
-
LINK_FLAGS " -Wl,-z,origin ")
-
diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
-
index 891c9e6d618c..8d963f3b0069 100644
-
--- a/cmake/modules/AddOCaml.cmake
-
+++ b/cmake/modules/AddOCaml.cmake
-
@@ -147,9 +147,9 @@ function(add_ocaml_library name)
-
endforeach()
-
-
if( APPLE )
-
- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "${LLVM_LIBRARY_DIR}")
-
elseif( UNIX )
-
- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(ocaml_rpath "${LLVM_LIBRARY_DIR}")
-
endif()
-
list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}")
-
-
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
-
index d99af79aa38e..21e794224b99 100644
-
--- a/cmake/modules/CMakeLists.txt
-
+++ b/cmake/modules/CMakeLists.txt
-
@@ -127,7 +127,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS
-
)
-
list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS)
-
-
-extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}")
-
+extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}")
-
set(LLVM_CONFIG_LIBRARY_DIRS
-
"${LLVM_CONFIG_LIBRARY_DIR}"
-
# FIXME: Should there be other entries here?
-
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-
index 370005cd8d7d..7e790bc52111 100644
-
--- a/tools/llvm-config/BuildVariables.inc.in
-
+++ b/tools/llvm-config/BuildVariables.inc.in
-
@@ -23,6 +23,7 @@
-
#define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
-
#define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
-
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
-
+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@"
-
#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
-
#define LLVM_INSTALL_PACKAGE_DIR "@LLVM_INSTALL_PACKAGE_DIR@"
-
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
-
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-
index e86eb2b44b10..f63e207e792e 100644
-
--- a/tools/llvm-config/llvm-config.cpp
-
+++ b/tools/llvm-config/llvm-config.cpp
-
@@ -366,7 +366,11 @@ int main(int argc, char **argv) {
-
sys::fs::make_absolute(ActivePrefix, Path);
-
ActiveBinDir = std::string(Path.str());
-
}
-
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
-
+ {
-
+ SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX);
-
+ sys::fs::make_absolute(ActivePrefix, Path);
-
+ ActiveLibDir = std::string(Path.str());
-
+ }
-
{
-
SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR);
-
sys::fs::make_absolute(ActivePrefix, Path);
pkgs/development/compilers/llvm/17/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch pkgs/development/compilers/llvm/18/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch
pkgs/development/compilers/llvm/17/openmp/fix-find-tool.patch pkgs/development/compilers/llvm/18/openmp/fix-find-tool.patch
-22
pkgs/development/compilers/llvm/17/openmp/gnu-install-dirs.patch
···
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
-
index b6ddbe90516d..311ab1d50e7f 100644
-
--- a/CMakeLists.txt
-
+++ b/CMakeLists.txt
-
@@ -29,7 +29,7 @@ if (OPENMP_STANDALONE_BUILD)
-
set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING
-
"Suffix of lib installation directory, e.g. 64 => lib64")
-
# Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR.
-
- set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}")
-
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}")
-
-
# Group test settings.
-
set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
-
@@ -40,7 +40,7 @@ if (OPENMP_STANDALONE_BUILD)
-
else()
-
set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
-
# If building in tree, we honor the same install suffix LLVM uses.
-
- set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
-
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-
-
if (NOT MSVC)
-
set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
+30 -34
pkgs/development/compilers/llvm/common/bintools.nix
···
inherit llvm lld;
};
}
-
(
-
''
-
mkdir -p $out/bin
-
for prog in ${lld}/bin/*; do
-
ln -s $prog $out/bin/${targetPrefix}$(basename $prog)
-
done
-
for prog in ${llvm}/bin/*; do
-
ln -sf $prog $out/bin/${targetPrefix}$(basename $prog)
-
done
+
''
+
mkdir -p $out/bin
+
for prog in ${lld}/bin/*; do
+
ln -s $prog $out/bin/${targetPrefix}$(basename $prog)
+
done
+
for prog in ${llvm}/bin/*; do
+
ln -sf $prog $out/bin/${targetPrefix}$(basename $prog)
+
done
-
llvmBin="${llvm}/bin"
+
llvmBin="${llvm}/bin"
-
ln -s $llvmBin/llvm-ar $out/bin/${targetPrefix}ar
-
ln -s $llvmBin/llvm-ar $out/bin/${targetPrefix}dlltool
-
ln -s $llvmBin/llvm-ar $out/bin/${targetPrefix}ranlib
-
ln -s $llvmBin/llvm-cxxfilt $out/bin/${targetPrefix}c++filt
-
ln -s $llvmBin/llvm-dwp $out/bin/${targetPrefix}dwp
-
ln -s $llvmBin/llvm-nm $out/bin/${targetPrefix}nm
-
ln -s $llvmBin/llvm-objcopy $out/bin/${targetPrefix}objcopy
-
ln -s $llvmBin/llvm-objcopy $out/bin/${targetPrefix}strip
-
ln -s $llvmBin/llvm-objdump $out/bin/${targetPrefix}objdump
-
ln -s $llvmBin/llvm-readobj $out/bin/${targetPrefix}readelf
-
ln -s $llvmBin/llvm-size $out/bin/${targetPrefix}size
-
ln -s $llvmBin/llvm-strings $out/bin/${targetPrefix}strings
-
ln -s $llvmBin/llvm-symbolizer $out/bin/${targetPrefix}addr2line
+
ln -s $llvmBin/llvm-ar $out/bin/${targetPrefix}ar
+
ln -s $llvmBin/llvm-ar $out/bin/${targetPrefix}dlltool
+
ln -s $llvmBin/llvm-ar $out/bin/${targetPrefix}ranlib
+
ln -s $llvmBin/llvm-cxxfilt $out/bin/${targetPrefix}c++filt
+
ln -s $llvmBin/llvm-dwp $out/bin/${targetPrefix}dwp
+
ln -s $llvmBin/llvm-nm $out/bin/${targetPrefix}nm
+
ln -s $llvmBin/llvm-objcopy $out/bin/${targetPrefix}objcopy
+
ln -s $llvmBin/llvm-objcopy $out/bin/${targetPrefix}strip
+
ln -s $llvmBin/llvm-objdump $out/bin/${targetPrefix}objdump
+
ln -s $llvmBin/llvm-readobj $out/bin/${targetPrefix}readelf
+
ln -s $llvmBin/llvm-size $out/bin/${targetPrefix}size
+
ln -s $llvmBin/llvm-strings $out/bin/${targetPrefix}strings
+
ln -s $llvmBin/llvm-symbolizer $out/bin/${targetPrefix}addr2line
-
if [ -e "$llvmBin/llvm-debuginfod" ]; then
-
ln -s $llvmBin/llvm-debuginfod $out/bin/${targetPrefix}debuginfod
-
ln -s $llvmBin/llvm-debuginfod-find $out/bin/${targetPrefix}debuginfod-find
-
fi
+
if [ -e "$llvmBin/llvm-debuginfod" ]; then
+
ln -s $llvmBin/llvm-debuginfod $out/bin/${targetPrefix}debuginfod
+
ln -s $llvmBin/llvm-debuginfod-find $out/bin/${targetPrefix}debuginfod-find
+
fi
-
ln -s ${lld}/bin/lld $out/bin/${targetPrefix}ld
+
ln -s ${lld}/bin/lld $out/bin/${targetPrefix}ld
-
# Only >=13 show GNU windres compatible in help
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "13") ''
-
ln -s $llvmBin/llvm-rc $out/bin/${targetPrefix}windres
-
''
-
)
+
# Only >=13 show GNU windres compatible in help
+
ln -s $llvmBin/llvm-rc $out/bin/${targetPrefix}windres
+
''
+9 -15
pkgs/development/compilers/llvm/common/bolt/default.nix
···
inherit version;
# Blank llvm dir just so relative path works
-
src = runCommand "bolt-src-${finalAttrs.version}" { inherit (monorepoSrc) passthru; } (
-
''
-
mkdir $out
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "14") ''
-
cp -r ${monorepoSrc}/cmake "$out"
-
''
-
+ ''
-
cp -r ${monorepoSrc}/${finalAttrs.pname} "$out"
-
cp -r ${monorepoSrc}/third-party "$out"
+
src = runCommand "bolt-src-${finalAttrs.version}" { inherit (monorepoSrc) passthru; } (''
+
mkdir $out
+
cp -r ${monorepoSrc}/cmake "$out"
+
cp -r ${monorepoSrc}/${finalAttrs.pname} "$out"
+
cp -r ${monorepoSrc}/third-party "$out"
-
# BOLT re-runs tablegen against LLVM sources, so needs them available.
-
cp -r ${monorepoSrc}/llvm/ "$out"
-
chmod -R +w $out/llvm
-
''
-
);
+
# BOLT re-runs tablegen against LLVM sources, so needs them available.
+
cp -r ${monorepoSrc}/llvm/ "$out"
+
chmod -R +w $out/llvm
+
'');
sourceRoot = "${finalAttrs.src.name}/bolt";
-13
pkgs/development/compilers/llvm/common/clang/clang-11-15-LLVMgold-path.patch
···
-
diff --git a/lib/Driver/ToolChains/CommonArgs.cpp b/lib/Driver/ToolChains/CommonArgs.cpp
-
index 6b6e276b8ce7..7896542a1202 100644
-
--- a/lib/Driver/ToolChains/CommonArgs.cpp
-
+++ b/lib/Driver/ToolChains/CommonArgs.cpp
-
@@ -409,7 +409,7 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
-
-
SmallString<1024> Plugin;
-
llvm::sys::path::native(
-
- Twine(D.Dir) + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold" + Suffix,
-
+ Twine("@libllvmLibdir@" "/LLVMgold") + Suffix,
-
Plugin);
-
CmdArgs.push_back(Args.MakeArgString(Plugin));
-
}
+73 -182
pkgs/development/compilers/llvm/common/clang/default.nix
···
src =
if monorepoSrc != null then
-
runCommand "clang-src-${version}" { inherit (monorepoSrc) passthru; } (
-
''
-
mkdir -p "$out"
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "14") ''
-
cp -r ${monorepoSrc}/cmake "$out"
-
''
-
+ ''
-
cp -r ${monorepoSrc}/clang "$out"
-
cp -r ${monorepoSrc}/clang-tools-extra "$out"
-
''
-
)
+
runCommand "clang-src-${version}" { inherit (monorepoSrc) passthru; } (''
+
mkdir -p "$out"
+
cp -r ${monorepoSrc}/cmake "$out"
+
cp -r ${monorepoSrc}/clang "$out"
+
cp -r ${monorepoSrc}/clang-tools-extra "$out"
+
'')
else
src;
···
# libraries. eg: `clang -munsupported hello.c -lc`
./clang-unsupported-option.patch
]
-
++
-
lib.optional (lib.versions.major release_version == "13")
-
# 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
-
(getVersionFile "clang/revert-malloc-alignment-assumption.patch")
-
++ lib.optional (lib.versionOlder release_version "17") (
-
if lib.versionAtLeast release_version "14" then
-
fetchpatch {
-
name = "ignore-nostd-link.patch";
-
url = "https://github.com/llvm/llvm-project/commit/5b77e752dcd073846b89559d6c0e1a7699e58615.patch";
-
relative = "clang";
-
hash = "sha256-qzSAmoGY+7POkDhcGgQRPaNQ3+7PIcIc9cZuiE/eLkc=";
-
}
-
else
-
./ignore-nostd-link-13.diff
-
)
# Pass the correct path to libllvm
++ [
-
(replaceVars
-
(
-
if (lib.versionOlder release_version "16") then
-
./clang-11-15-LLVMgold-path.patch
-
else
-
./clang-at-least-16-LLVMgold-path.patch
-
)
-
{
-
libllvmLibdir = "${libllvm.lib}/lib";
-
}
-
)
+
(replaceVars ./clang-at-least-16-LLVMgold-path.patch {
+
libllvmLibdir = "${libllvm.lib}/lib";
+
})
]
-
# Backport version logic from Clang 16. This is needed by the following patch.
-
++ lib.optional (lib.versions.major release_version == "15") (fetchpatch {
-
name = "clang-darwin-Use-consistent-version-define-stringifying-logic.patch";
-
url = "https://github.com/llvm/llvm-project/commit/60a33ded751c86fff9ac1c4bdd2b341fbe4b0649.patch?full_index=1";
-
includes = [ "lib/Basic/Targets/OSTargets.cpp" ];
-
stripLen = 1;
-
hash = "sha256-YVTSg5eZLz3po2AUczPNXCK26JA3CuTh6Iqp7hAAKIs=";
-
})
-
# Backport `__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__` support from Clang 17.
-
# This is needed by newer SDKs (14+).
-
++
-
lib.optional
-
(
-
lib.versionAtLeast (lib.versions.major release_version) "15"
-
&& lib.versionOlder (lib.versions.major release_version) "17"
-
)
-
(fetchpatch {
-
name = "clang-darwin-An-OS-version-preprocessor-define.patch";
-
url = "https://github.com/llvm/llvm-project/commit/c8e2dd8c6f490b68e41fe663b44535a8a21dfeab.patch?full_index=1";
-
includes = [ "lib/Basic/Targets/OSTargets.cpp" ];
-
stripLen = 1;
-
hash = "sha256-Vs32kql7N6qtLqc12FtZHURcbenA7+N3E/nRRX3jdig=";
-
})
# Fixes a bunch of lambda-related crashes
# https://github.com/llvm/llvm-project/pull/93206
++ lib.optional (lib.versions.major release_version == "18") (fetchpatch {
···
];
stripLen = 1;
hash = "sha256-1NKej08R9SPlbDY/5b0OKUsHjX07i9brR84yXiPwi7E=";
-
})
-
++
-
lib.optional (stdenv.isAarch64 && lib.versions.major release_version == "17")
-
# Fixes llvm17 tblgen builds on aarch64.
-
# https://github.com/llvm/llvm-project/issues/106521#issuecomment-2337175680
-
(getVersionFile "clang/aarch64-tblgen.patch");
+
});
nativeBuildInputs = [
cmake
python3
+
ninja
]
-
++ (lib.optional (lib.versionAtLeast release_version "15") ninja)
-
++ lib.optional (lib.versionAtLeast version "18" && enableManpages) python3.pkgs.myst-parser
-
++ lib.optional enableManpages python3.pkgs.sphinx
+
++ lib.optionals enableManpages [
+
python3.pkgs.myst-parser
+
python3.pkgs.sphinx
+
]
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [
···
libllvm
];
-
cmakeFlags =
-
(lib.optionals (lib.versionAtLeast release_version "15") [
-
(lib.cmakeFeature "CLANG_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/clang")
-
])
-
++ [
-
(lib.cmakeBool "CLANGD_BUILD_XPC" false)
-
(lib.cmakeBool "LLVM_ENABLE_RTTI" true)
-
(lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen")
-
(lib.cmakeFeature "CLANG_TABLEGEN" "${buildLlvmTools.tblgen}/bin/clang-tblgen")
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "21") [
-
(lib.cmakeFeature "CLANG_RESOURCE_DIR" "${placeholder "lib"}/lib/clang/${lib.versions.major release_version}")
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "17") [
-
(lib.cmakeBool "LLVM_INCLUDE_TESTS" false)
-
]
-
++ lib.optionals enableManpages [
-
(lib.cmakeBool "CLANG_INCLUDE_DOCS" true)
-
(lib.cmakeBool "LLVM_ENABLE_SPHINX" true)
-
(lib.cmakeBool "SPHINX_OUTPUT_MAN" true)
-
(lib.cmakeBool "SPHINX_OUTPUT_HTML" false)
-
(lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false)
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "15") [
-
# Added in LLVM15:
-
# `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb
-
# `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7
-
(lib.cmakeFeature "CLANG_TIDY_CONFUSABLE_CHARS_GEN" "${buildLlvmTools.tblgen}/bin/clang-tidy-confusable-chars-gen")
-
]
-
++ lib.optionals (lib.versionOlder release_version "20") [
-
# clang-pseudo removed in LLVM20: https://github.com/llvm/llvm-project/commit/ed8f78827895050442f544edef2933a60d4a7935
-
(lib.cmakeFeature "CLANG_PSEUDO_GEN" "${buildLlvmTools.tblgen}/bin/clang-pseudo-gen")
-
]
-
++ lib.optional (lib.versionAtLeast release_version "20") (
-
lib.cmakeFeature "LLVM_DIR" "${libllvm.dev}/lib/cmake/llvm"
-
)
-
++ devExtraCmakeFlags;
+
cmakeFlags = [
+
(lib.cmakeFeature "CLANG_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/clang")
+
(lib.cmakeBool "CLANGD_BUILD_XPC" false)
+
(lib.cmakeBool "LLVM_ENABLE_RTTI" true)
+
(lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen")
+
(lib.cmakeFeature "CLANG_TABLEGEN" "${buildLlvmTools.tblgen}/bin/clang-tblgen")
+
]
+
++ lib.optionals (lib.versionAtLeast release_version "21") [
+
(lib.cmakeFeature "CLANG_RESOURCE_DIR" "${placeholder "lib"}/lib/clang/${lib.versions.major release_version}")
+
]
+
# TODO: Clean up on `staging`.
+
++ [
+
(lib.cmakeBool "LLVM_INCLUDE_TESTS" false)
+
]
+
++ lib.optionals enableManpages [
+
(lib.cmakeBool "CLANG_INCLUDE_DOCS" true)
+
(lib.cmakeBool "LLVM_ENABLE_SPHINX" true)
+
(lib.cmakeBool "SPHINX_OUTPUT_MAN" true)
+
(lib.cmakeBool "SPHINX_OUTPUT_HTML" false)
+
(lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false)
+
]
+
# TODO: Clean up on `staging`.
+
++ [
+
# Added in LLVM15:
+
# `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb
+
# `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7
+
(lib.cmakeFeature "CLANG_TIDY_CONFUSABLE_CHARS_GEN" "${buildLlvmTools.tblgen}/bin/clang-tidy-confusable-chars-gen")
+
]
+
++ lib.optionals (lib.versionOlder release_version "20") [
+
# clang-pseudo removed in LLVM20: https://github.com/llvm/llvm-project/commit/ed8f78827895050442f544edef2933a60d4a7935
+
(lib.cmakeFeature "CLANG_PSEUDO_GEN" "${buildLlvmTools.tblgen}/bin/clang-pseudo-gen")
+
]
+
++ lib.optional (lib.versionAtLeast release_version "20") (
+
lib.cmakeFeature "LLVM_DIR" "${libllvm.dev}/lib/cmake/llvm"
+
)
+
++ devExtraCmakeFlags;
postPatch = ''
# Make sure clang passes the correct location of libLTO to ld64
···
postInstall = ''
ln -sv $out/bin/clang $out/bin/cpp
''
-
+ (lib.optionalString (lib.versions.major release_version == "17") ''
-
mkdir -p $lib/lib/clang
-
mv $lib/lib/17 $lib/lib/clang/17
-
'')
+ (lib.optionalString
((lib.versionAtLeast release_version "19") && !(lib.versionAtLeast release_version "21"))
''
···
# Move libclang to 'lib' output
moveToOutput "lib/libclang.*" "$lib"
moveToOutput "lib/libclang-cpp.*" "$lib"
+
mkdir -p $python/bin $python/share/clang/
''
-
+ (
-
if lib.versionOlder release_version "15" then
-
''
-
mkdir -p $python/bin $python/share/{clang,scan-view}
-
''
-
else
-
''
-
mkdir -p $python/bin $python/share/clang/
-
''
-
)
+ ''
mv $out/bin/{git-clang-format,scan-view} $python/bin
if [ -e $out/bin/set-xcode-analyzer ]; then
mv $out/bin/set-xcode-analyzer $python/bin
fi
mv $out/share/clang/*.py $python/share/clang
-
''
-
+ (lib.optionalString (lib.versionOlder release_version "15") ''
-
mv $out/share/scan-view/*.py $python/share/scan-view
-
'')
-
+ ''
rm $out/bin/c-index-test
patchShebangs $python/bin
mkdir -p $dev/bin
''
+ (
-
if lib.versionOlder release_version "15" then
-
''
-
cp bin/clang-tblgen $dev/bin
-
''
-
else if lib.versionOlder release_version "20" then
+
if lib.versionOlder release_version "20" then
''
cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin
''
···
);
env =
-
lib.optionalAttrs
-
(
-
stdenv.buildPlatform != stdenv.hostPlatform
-
&& !stdenv.hostPlatform.useLLVM
-
&& lib.versionAtLeast release_version "15"
-
)
+
lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform && !stdenv.hostPlatform.useLLVM)
{
# The following warning is triggered with (at least) gcc >=
# 12, but appears to occur only for cross compiles.
···
hardeningUnsupportedFlagsByTargetPlatform =
targetPlatform:
[ "fortify3" ]
-
++ lib.optional (
-
(lib.versionOlder release_version "7") || !targetPlatform.isLinux || !targetPlatform.isx86_64
-
) "shadowstack"
-
++ lib.optional (
-
(lib.versionOlder release_version "8") || !targetPlatform.isAarch64 || !targetPlatform.isLinux
-
) "pacret"
+
++ lib.optional (!targetPlatform.isLinux || !targetPlatform.isx86_64) "shadowstack"
+
++ lib.optional (!targetPlatform.isAarch64 || !targetPlatform.isLinux) "pacret"
++ lib.optional (
-
(lib.versionOlder release_version "11")
-
|| (targetPlatform.isAarch64 && (lib.versionOlder release_version "18.1"))
-
|| (targetPlatform.isFreeBSD && (lib.versionOlder release_version "15"))
-
|| !(targetPlatform.isLinux || targetPlatform.isFreeBSD)
+
!(targetPlatform.isLinux || targetPlatform.isFreeBSD)
|| !(
targetPlatform.isx86
|| targetPlatform.isPower64
···
|| targetPlatform.isAarch64
)
) "stackclashprotection"
-
++ lib.optional (
-
(lib.versionOlder release_version "15") || !(targetPlatform.isx86_64 || targetPlatform.isAarch64)
-
) "zerocallusedregs"
-
++ lib.optional (lib.versionOlder release_version "15") "strictflexarrays1"
-
++ lib.optional (lib.versionOlder release_version "16") "strictflexarrays3"
+
++ lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs"
++ (finalAttrs.passthru.hardeningUnsupportedFlags or [ ]);
};
···
mainProgram = "clang";
};
}
-
// lib.optionalAttrs enableManpages (
-
{
-
pname = "clang-manpages";
+
// lib.optionalAttrs enableManpages {
+
pname = "clang-manpages";
+
+
ninjaFlags = [ "docs-clang-man" ];
-
installPhase = ''
-
mkdir -p $out/share/man/man1
-
# Manually install clang manpage
-
cp docs/man/*.1 $out/share/man/man1/
-
'';
+
installPhase = ''
+
mkdir -p $out/share/man/man1
+
# Manually install clang manpage
+
cp docs/man/*.1 $out/share/man/man1/
+
'';
-
outputs = [ "out" ];
+
outputs = [ "out" ];
-
doCheck = false;
+
doCheck = false;
-
meta = llvm_meta // {
-
description = "man page for Clang ${version}";
-
};
-
}
-
// (
-
if lib.versionOlder release_version "15" then
-
{
-
buildPhase = ''
-
make docs-clang-man
-
'';
-
}
-
else
-
{
-
ninjaFlags = [ "docs-clang-man" ];
-
}
-
)
-
)
+
meta = llvm_meta // {
+
description = "man page for Clang ${version}";
+
};
+
}
)
-57
pkgs/development/compilers/llvm/common/clang/ignore-nostd-link-13.diff
···
-
backported to clang-12 & clang-13 from https://github.com/llvm/llvm-project/commit/5b77e752dcd073846b89559d6c0e1a7699e58615
-
diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td
-
index a0cbcae..8797646 100644
-
--- a/include/clang/Driver/Options.td
-
+++ b/include/clang/Driver/Options.td
-
@@ -2931,7 +2931,7 @@ def headerpad__max__install__names : Joined<["-"], "headerpad_max_install_names"
-
def help : Flag<["-", "--"], "help">, Flags<[CC1Option,CC1AsOption, FC1Option,
-
FlangOption]>, HelpText<"Display available options">,
-
MarshallingInfoFlag<FrontendOpts<"ShowHelp">>;
-
-def ibuiltininc : Flag<["-"], "ibuiltininc">,
-
+def ibuiltininc : Flag<["-"], "ibuiltininc">, Group<clang_i_Group>,
-
HelpText<"Enable builtin #include directories even when -nostdinc is used "
-
"before or after -ibuiltininc. "
-
"Using -nobuiltininc after the option disables it">;
-
@@ -3641,10 +3641,11 @@ def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, Group<clang_ignored_f_Group>
-
def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">, Flags<[NoXarchOption]>;
-
def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group<pedantic_Group>;
-
def no__dead__strip__inits__and__terms : Flag<["-"], "no_dead_strip_inits_and_terms">;
-
-def nobuiltininc : Flag<["-"], "nobuiltininc">, Flags<[CC1Option, CoreOption]>,
-
+def nobuiltininc : Flag<["-"], "nobuiltininc">, Flags<[CC1Option, CoreOption]>, Group<IncludePath_Group>,
-
HelpText<"Disable builtin #include directories">,
-
MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseBuiltinIncludes">>;
-
-def nogpuinc : Flag<["-"], "nogpuinc">, HelpText<"Do not add include paths for CUDA/HIP and"
-
+def nogpuinc : Flag<["-"], "nogpuinc">, Group<IncludePath_Group>,
-
+ HelpText<"Do not add include paths for CUDA/HIP and"
-
" do not include the default CUDA/HIP wrapper headers">;
-
def : Flag<["-"], "nocudainc">, Alias<nogpuinc>;
-
def nogpulib : Flag<["-"], "nogpulib">,
-
@@ -3660,9 +3661,9 @@ def noprebind : Flag<["-"], "noprebind">;
-
def noprofilelib : Flag<["-"], "noprofilelib">;
-
def noseglinkedit : Flag<["-"], "noseglinkedit">;
-
def nostartfiles : Flag<["-"], "nostartfiles">, Group<Link_Group>;
-
-def nostdinc : Flag<["-"], "nostdinc">, Flags<[CoreOption]>;
-
-def nostdlibinc : Flag<["-"], "nostdlibinc">;
-
-def nostdincxx : Flag<["-"], "nostdinc++">, Flags<[CC1Option]>,
-
+def nostdinc : Flag<["-"], "nostdinc">, Flags<[CoreOption]>, Group<IncludePath_Group>;
-
+def nostdlibinc : Flag<["-"], "nostdlibinc">, Group<IncludePath_Group>;
-
+def nostdincxx : Flag<["-"], "nostdinc++">, Flags<[CC1Option]>, Group<IncludePath_Group>,
-
HelpText<"Disable standard #include directories for the C++ standard library">,
-
MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseStandardCXXIncludes">>;
-
def nostdlib : Flag<["-"], "nostdlib">, Group<Link_Group>;
-
diff --git a/test/Driver/linker-opts.c b/test/Driver/linker-opts.c
-
index e1673f7..b9beb91 100644
-
--- a/test/Driver/linker-opts.c
-
+++ b/test/Driver/linker-opts.c
-
@@ -16,9 +16,8 @@
-
//
-
// Make sure that we don't warn on unused compiler arguments.
-
// RUN: %clang -Xclang -I. -x c %s -c -o %t/tmp.o
-
-// RUN: %clang -Xclang -I. %t/tmp.o -o %t/tmp -### 2>&1 | FileCheck %s --check-prefix=NO-UNUSED
-
-// NO-UNUSED-NOT: warning:{{.*}}unused
-
-//
-
+// RUN: %clang -### -I. -ibuiltininc -nobuiltininc -nostdinc -nostdinc++ -nostdlibinc -nogpuinc %t/tmp.o -o /dev/null 2>&1 | FileCheck /dev/null --implicit-check-not=warning:
-
+
-
// Make sure that we do warn in other cases.
-
// RUN: %clang %s -lfoo -c -o %t/tmp2.o -### 2>&1 | FileCheck %s --check-prefix=UNUSED
-
// UNUSED: warning:{{.*}}unused
+3 -3
pkgs/development/compilers/llvm/common/common-let.nix
···
++ lib.platforms.s390x
++ lib.platforms.wasi
++ lib.platforms.x86
-
++ lib.optionals (lib.versionAtLeast release_version "7") lib.platforms.riscv
-
++ lib.optionals (lib.versionAtLeast release_version "14") lib.platforms.m68k
-
++ lib.optionals (lib.versionAtLeast release_version "16") lib.platforms.loongarch64;
+
++ lib.platforms.riscv
+
++ lib.platforms.m68k
+
++ lib.platforms.loongarch64;
};
releaseInfo =
-75
pkgs/development/compilers/llvm/common/compiler-rt/armv6-mcr-dmb.patch
···
-
From a11d1cc41c725ec6dee58f75e4a852a658dd7543 Mon Sep 17 00:00:00 2001
-
From: Khem Raj <raj.khem@gmail.com>
-
Date: Thu, 10 Mar 2022 19:30:00 -0800
-
Subject: [PATCH] [builtins] Use mcr for dmb instruction on armv6
-
-
At present compiler-rt cross compiles for armv6 ( -march=armv6 ) but includes
-
dmb instructions which are only available in armv7+ this causes SIGILL on
-
clang+compiler-rt compiled components on rpi0w platforms.
-
-
Reviewed By: MaskRay
-
-
Differential Revision: https://reviews.llvm.org/D99282
-
---
-
compiler-rt/lib/builtins/arm/sync-ops.h | 8 ++++----
-
compiler-rt/lib/builtins/assembly.h | 8 ++++++++
-
2 files changed, 12 insertions(+), 4 deletions(-)
-
-
diff --git a/lib/builtins/arm/sync-ops.h b/lib/builtins/arm/sync-ops.h
-
index c9623249e5d20..7a26170741ad2 100644
-
--- a/lib/builtins/arm/sync-ops.h
-
+++ b/lib/builtins/arm/sync-ops.h
-
@@ -19,14 +19,14 @@
-
.thumb; \
-
.syntax unified; \
-
DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \
-
- dmb; \
-
+ DMB; \
-
mov r12, r0; \
-
LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \
-
op(r2, r0, r1); \
-
strex r3, r2, [r12]; \
-
cmp r3, #0; \
-
bne LOCAL_LABEL(tryatomic_##op); \
-
- dmb; \
-
+ DMB; \
-
bx lr
-
-
#define SYNC_OP_8(op) \
-
@@ -35,14 +35,14 @@
-
.syntax unified; \
-
DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \
-
push {r4, r5, r6, lr}; \
-
- dmb; \
-
+ DMB; \
-
mov r12, r0; \
-
LOCAL_LABEL(tryatomic_##op) : ldrexd r0, r1, [r12]; \
-
op(r4, r5, r0, r1, r2, r3); \
-
strexd r6, r4, r5, [r12]; \
-
cmp r6, #0; \
-
bne LOCAL_LABEL(tryatomic_##op); \
-
- dmb; \
-
+ DMB; \
-
pop { r4, r5, r6, pc }
-
-
#define MINMAX_4(rD, rN, rM, cmp_kind) \
-
diff --git a/lib/builtins/assembly.h b/lib/builtins/assembly.h
-
index 69a3d8620f924..06aa18162e3b4 100644
-
--- a/lib/builtins/assembly.h
-
+++ b/lib/builtins/assembly.h
-
@@ -189,6 +189,14 @@
-
JMP(ip)
-
#endif
-
-
+#if __ARM_ARCH >= 7
-
+#define DMB dmb
-
+#elif __ARM_ARCH >= 6
-
+#define DMB mcr p15, #0, r0, c7, c10, #5
-
+#else
-
+#error only supported on ARMv6+
-
+#endif
-
+
-
#if defined(USE_THUMB_2)
-
#define WIDE(op) op.w
-
#else
-
-34
pkgs/development/compilers/llvm/common/compiler-rt/armv6-scudo-no-yield.patch
···
-
From ff0b373b959165477f45d9f5f9a8da471ae111ab Mon Sep 17 00:00:00 2001
-
From: Ben Wolsieffer <benwolsieffer@gmail.com>
-
Date: Wed, 7 Dec 2022 18:03:56 -0500
-
Subject: [PATCH] [scudo][standalone] Only use yield on ARMv6K and newer
-
-
The yield instruction is only available in ARMv6K and newer. It behaves as a
-
nop on single threaded platforms anyway, so use nop instead on unsupported
-
architectures.
-
-
Differential Revision: https://reviews.llvm.org/D139600
-
---
-
compiler-rt/lib/scudo/standalone/common.h | 5 +++++
-
1 file changed, 5 insertions(+)
-
-
diff --git a/lib/scudo/standalone/common.h b/lib/scudo/standalone/common.h
-
index bc3dfec6dbba..862cda1d4bc4 100644
-
--- a/lib/scudo/standalone/common.h
-
+++ b/lib/scudo/standalone/common.h
-
@@ -109,7 +109,12 @@ inline void yieldProcessor(u8 Count) {
-
#elif defined(__aarch64__) || defined(__arm__)
-
__asm__ __volatile__("" ::: "memory");
-
for (u8 I = 0; I < Count; I++)
-
+#if __ARM_ARCH >= 6 && !defined(__ARM_ARCH_6__)
-
+ // yield is supported on ARMv6K and newer
-
__asm__ __volatile__("yield");
-
+#else
-
+ __asm__ __volatile__("nop");
-
+#endif
-
#endif
-
__asm__ __volatile__("" ::: "memory");
-
}
-
--
-
2.38.1
-
-52
pkgs/development/compilers/llvm/common/compiler-rt/armv6-sync-ops-no-thumb.patch
···
-
From 5017de8ba4b1fe985169cf54590e858a9019a91f Mon Sep 17 00:00:00 2001
-
From: Khem Raj <raj.khem@gmail.com>
-
Date: Fri, 11 Mar 2022 16:25:49 -0800
-
Subject: [PATCH] [builtins] Do not force thumb mode directive in
-
arm/sync-ops.h
-
-
.thumb_func was not switching mode until [1]
-
so it did not show up but now that .thumb_func (without argument) is
-
switching mode, its causing build failures on armv6 ( rpi0 ) even when
-
build is explicitly asking for this file to be built with -marm (ARM
-
mode), therefore use DEFINE_COMPILERRT_FUNCTION macro to add function
-
header which considers arch and mode from compiler cmdline to decide if
-
the function is built using thumb mode or arm mode.
-
-
[1] https://reviews.llvm.org/D101975
-
-
Note that it also needs https://reviews.llvm.org/D99282
-
-
Reviewed By: peter.smith, MaskRay
-
-
Differential Revision: https://reviews.llvm.org/D104183
-
---
-
compiler-rt/lib/builtins/arm/sync-ops.h | 6 ++----
-
1 file changed, 2 insertions(+), 4 deletions(-)
-
-
diff --git a/lib/builtins/arm/sync-ops.h b/lib/builtins/arm/sync-ops.h
-
index 7a26170741ad2..d914f9d3a1093 100644
-
--- a/lib/builtins/arm/sync-ops.h
-
+++ b/lib/builtins/arm/sync-ops.h
-
@@ -16,9 +16,8 @@
-
-
#define SYNC_OP_4(op) \
-
.p2align 2; \
-
- .thumb; \
-
.syntax unified; \
-
- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \
-
+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \
-
DMB; \
-
mov r12, r0; \
-
LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \
-
@@ -31,9 +30,8 @@
-
-
#define SYNC_OP_8(op) \
-
.p2align 2; \
-
- .thumb; \
-
.syntax unified; \
-
- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \
-
+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \
-
push {r4, r5, r6, lr}; \
-
DMB; \
-
mov r12, r0; \
-
-32
pkgs/development/compilers/llvm/common/compiler-rt/armv7l-15.patch
···
-
diff -ur a/cmake/builtin-config-ix.cmake b/cmake/builtin-config-ix.cmake
-
--- a/cmake/builtin-config-ix.cmake @llvm 15.0.6
-
+++ b/cmake/builtin-config-ix.cmake
-
@@ -46,7 +46,7 @@
-
-
set(ARM64 aarch64)
-
-set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv8m.main armv8.1m.main)
-
+set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l armv8m.main armv8.1m.main)
-
set(AVR avr)
-
set(HEXAGON hexagon)
-
set(X86 i386)
-
set(X86_64 x86_64)
-
diff -ur a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt
-
--- a/lib/builtins/CMakeLists.txt @llvm 15.0.6
-
+++ b/lib/builtins/CMakeLists.txt
-
@@ -565,6 +565,7 @@
-
set(armv7_SOURCES ${arm_SOURCES})
-
set(armv7s_SOURCES ${arm_SOURCES})
-
set(armv7k_SOURCES ${arm_SOURCES})
-
+set(armv7l_SOURCES ${arm_SOURCES})
-
set(arm64_SOURCES ${aarch64_SOURCES})
-
-
# macho_embedded archs
-
@@ -734,7 +735,7 @@
-
foreach (arch ${BUILTIN_SUPPORTED_ARCH})
-
if (CAN_TARGET_${arch})
-
# For ARM archs, exclude any VFP builtins if VFP is not supported
-
- if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em|armv8m.main|armv8.1m.main)$")
-
+ if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em|armv8m.main|armv8.1m.main)$")
-
string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}")
-
check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP)
-
if(NOT COMPILER_RT_HAS_${arch}_VFP)
+28 -100
pkgs/development/compilers/llvm/common/compiler-rt/default.nix
···
# TODO: Make this account for GCC having libstdcxx, which will help
# use clean up the `cmakeFlags` rats nest below.
haveLibcxx = stdenv.cc.libcxx != null;
-
isDarwinStatic =
-
stdenv.hostPlatform.isDarwin
-
&& stdenv.hostPlatform.isStatic
-
&& lib.versionAtLeast release_version "16";
+
isDarwinStatic = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic;
inherit (stdenv.hostPlatform) isMusl isAarch64 isWindows;
noSanitizers = !haveLibc || bareMetal || isMusl || isDarwinStatic || isWindows;
in
···
runCommand "compiler-rt-src-${version}" { inherit (monorepoSrc) passthru; } (
''
mkdir -p "$out"
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "14") ''
cp -r ${monorepoSrc}/cmake "$out"
''
+ lib.optionalString (lib.versionAtLeast release_version "21") ''
···
sourceRoot = "${finalAttrs.src.name}/compiler-rt";
-
patches =
-
lib.optional (lib.versionOlder release_version "15") (getVersionFile "compiler-rt/codesign.patch") # Revert compiler-rt commit that makes codesign mandatory
-
++ [
-
(getVersionFile "compiler-rt/X86-support-extension.patch") # Add support for i486 i586 i686 by reusing i386 config
-
# ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the
-
# extra `/`.
-
(getVersionFile "compiler-rt/normalize-var.patch")
-
# Fix build on armv6l
-
./armv6-no-ldrexd-strexd.patch
-
]
-
++ lib.optional (lib.versions.major release_version == "12") (fetchpatch {
-
# fixes the parallel build on aarch64 darwin
-
name = "fix-symlink-race-aarch64-darwin.patch";
-
url = "https://github.com/llvm/llvm-project/commit/b31080c596246bc26d2493cfd5e07f053cf9541c.patch";
-
relative = "compiler-rt";
-
hash = "sha256-Cv2NC8402yU7QaTR6TzdH+qyWRy+tTote7KKWtKRWFQ=";
-
})
-
++ lib.optional (
-
lib.versions.major release_version == "12"
-
|| (lib.versionAtLeast release_version "14" && lib.versionOlder release_version "18")
-
) (getVersionFile "compiler-rt/gnu-install-dirs.patch")
-
++
-
lib.optional (lib.versionAtLeast release_version "13" && lib.versionOlder release_version "18")
-
(fetchpatch {
-
name = "cfi_startproc-after-label.patch";
-
url = "https://github.com/llvm/llvm-project/commit/7939ce39dac0078fef7183d6198598b99c652c88.patch";
-
stripLen = 1;
-
hash = "sha256-tGqXsYvUllFrPa/r/dsKVlwx5IrcJGccuR1WAtUg7/o=";
-
})
-
++
-
lib.optional (lib.versionAtLeast release_version "13" && lib.versionOlder release_version "18")
-
# Prevent a compilation error on darwin
-
(getVersionFile "compiler-rt/darwin-targetconditionals.patch")
-
# TODO: make unconditional and remove in <15 section below. Causes rebuilds.
-
++ lib.optionals (lib.versionAtLeast release_version "15") [
-
# See: https://github.com/NixOS/nixpkgs/pull/186575
-
./darwin-plistbuddy-workaround.patch
-
]
-
++
-
lib.optional (lib.versions.major release_version == "15")
-
# See: https://github.com/NixOS/nixpkgs/pull/194634#discussion_r999829893
-
./armv7l-15.patch
-
++ lib.optionals (lib.versionOlder release_version "15") [
-
./darwin-plistbuddy-workaround.patch
-
(getVersionFile "compiler-rt/armv7l.patch")
-
# Fix build on armv6l
-
./armv6-mcr-dmb.patch
-
./armv6-sync-ops-no-thumb.patch
-
]
-
++
-
lib.optionals (lib.versionAtLeast release_version "13" && lib.versionOlder release_version "18")
-
[
-
# Fix build on armv6l
-
./armv6-scudo-no-yield.patch
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "13") [
-
(getVersionFile "compiler-rt/armv6-scudo-libatomic.patch")
-
]
-
++ lib.optional (lib.versions.major release_version == "19") (fetchpatch {
-
url = "https://github.com/llvm/llvm-project/pull/99837/commits/14ae0a660a38e1feb151928a14f35ff0f4487351.patch";
-
hash = "sha256-JykABCaNNhYhZQxCvKiBn54DZ5ZguksgCHnpdwWF2no=";
-
relative = "compiler-rt";
-
});
+
patches = [
+
(getVersionFile "compiler-rt/X86-support-extension.patch") # Add support for i486 i586 i686 by reusing i386 config
+
# ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the
+
# extra `/`.
+
(getVersionFile "compiler-rt/normalize-var.patch")
+
# Fix build on armv6l
+
./armv6-no-ldrexd-strexd.patch
+
# See: https://github.com/NixOS/nixpkgs/pull/186575
+
./darwin-plistbuddy-workaround.patch
+
]
+
++ [
+
(getVersionFile "compiler-rt/armv6-scudo-libatomic.patch")
+
]
+
++ lib.optional (lib.versions.major release_version == "19") (fetchpatch {
+
url = "https://github.com/llvm/llvm-project/pull/99837/commits/14ae0a660a38e1feb151928a14f35ff0f4487351.patch";
+
hash = "sha256-JykABCaNNhYhZQxCvKiBn54DZ5ZguksgCHnpdwWF2no=";
+
relative = "compiler-rt";
+
});
nativeBuildInputs = [
cmake
python3
libllvm.dev
+
ninja
]
-
++ (lib.optional (lib.versionAtLeast release_version "15") ninja)
++ lib.optionals stdenv.hostPlatform.isDarwin [ jq ];
buildInputs =
lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isRiscV) linuxHeaders
···
(lib.cmakeFeature "SANITIZER_CXX_ABI_LIBNAME" "libcxxabi")
(lib.cmakeBool "COMPILER_RT_USE_BUILTINS_LIBRARY" true)
]
-
++
-
lib.optionals
-
((!haveLibc || bareMetal || isMusl || isAarch64) && (lib.versions.major release_version == "13"))
-
[
-
(lib.cmakeBool "COMPILER_RT_BUILD_LIBFUZZER" false)
-
]
++ lib.optionals (useLLVM && haveLibc) [
(lib.cmakeBool "COMPILER_RT_BUILD_SANITIZERS" true)
(lib.cmakeBool "COMPILER_RT_BUILD_PROFILE" true)
···
(lib.cmakeFeature "COMPILER_RT_OS_DIR" "baremetal")
]
++ lib.optionals (stdenv.hostPlatform.isDarwin) (
-
lib.optionals (lib.versionAtLeast release_version "16") [
+
[
(lib.cmakeFeature "CMAKE_LIPO" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}lipo")
]
++ lib.optionals (!haveLibcxx) [
···
(lib.cmakeFeature "DARWIN_osx_ARCHS" stdenv.hostPlatform.darwinArch)
(lib.cmakeFeature "DARWIN_osx_BUILTIN_ARCHS" stdenv.hostPlatform.darwinArch)
(lib.cmakeFeature "SANITIZER_MIN_OSX_VERSION" stdenv.hostPlatform.darwinMinVersion)
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "15") [
# `COMPILER_RT_DEFAULT_TARGET_ONLY` does not apply to Darwin:
# https://github.com/llvm/llvm-project/blob/27ef42bec80b6c010b7b3729ed0528619521a690/compiler-rt/cmake/base-config-ix.cmake#L153
(lib.cmakeBool "COMPILER_RT_ENABLE_IOS" false)
···
''
substituteInPlace lib/builtins/clear_cache.c \
--replace-fail "#include <assert.h>" ""
-
substituteInPlace lib/builtins/cpu_model${lib.optionalString (lib.versionAtLeast release_version "18") "/x86"}.c \
+
substituteInPlace lib/builtins/cpu_model/x86.c \
--replace-fail "#include <assert.h>" ""
''
)
)
-
+
-
lib.optionalString
-
(lib.versionAtLeast release_version "13" && lib.versionOlder release_version "14")
-
''
-
# https://github.com/llvm/llvm-project/blob/llvmorg-14.0.6/libcxx/utils/merge_archives.py
-
# Seems to only be used in v13 though it's present in v12 and v14, and dropped in v15.
-
substituteInPlace ../libcxx/utils/merge_archives.py \
-
--replace-fail "import distutils.spawn" "from shutil import which as find_executable" \
-
--replace-fail "distutils.spawn." ""
-
''
+
lib.optionalString (lib.versionAtLeast release_version "19")
# codesign in sigtool doesn't support the various options used by the build
···
--replace-fail 'find_program(CODESIGN codesign)' ""
'';
-
preConfigure =
-
lib.optionalString (lib.versionOlder release_version "16" && !haveLibc) ''
-
cmakeFlagsArray+=(-DCMAKE_C_FLAGS="-nodefaultlibs -ffreestanding")
-
''
-
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
-
cmakeFlagsArray+=(
-
"-DDARWIN_macosx_CACHED_SYSROOT=$SDKROOT"
-
"-DDARWIN_macosx_OVERRIDE_SDK_VERSION=$(jq -r .Version "$SDKROOT/SDKSettings.json")"
-
)
-
'';
+
preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
+
cmakeFlagsArray+=(
+
"-DDARWIN_macosx_CACHED_SYSROOT=$SDKROOT"
+
"-DDARWIN_macosx_OVERRIDE_SDK_VERSION=$(jq -r .Version "$SDKROOT/SDKSettings.json")"
+
)
+
'';
# Hack around weird upstream RPATH bug
postInstall =
-48
pkgs/development/compilers/llvm/common/compiler-rt/glibc.patch
···
-
diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-
index 54da635..c5dc1cd 100644
-
--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-
+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-
@@ -1158,8 +1158,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
-
CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
-
CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
-
CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
-
-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
-
-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
-
+#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
-
+/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
-
+ on many architectures. */
-
CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
-
#endif
-
-
diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
-
index f89a113..f6f986f 100644
-
--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h
-
+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
-
@@ -213,26 +213,13 @@ namespace __sanitizer {
-
u64 __unused1;
-
u64 __unused2;
-
#elif defined(__sparc__)
-
-#if defined(__arch64__)
-
unsigned mode;
-
- unsigned short __pad1;
-
-#else
-
- unsigned short __pad1;
-
- unsigned short mode;
-
unsigned short __pad2;
-
-#endif
-
unsigned short __seq;
-
unsigned long long __unused1;
-
unsigned long long __unused2;
-
-#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__)
-
- unsigned int mode;
-
- unsigned short __seq;
-
- unsigned short __pad1;
-
- unsigned long __unused1;
-
- unsigned long __unused2;
-
#else
-
- unsigned short mode;
-
- unsigned short __pad1;
-
+ unsigned int mode;
-
unsigned short __seq;
-
unsigned short __pad2;
-
#if defined(__x86_64__) && !defined(_LP64)
-80
pkgs/development/compilers/llvm/common/compiler-rt/libsanitizer-no-cyclades-9.patch
···
-
https://github.com/llvm/llvm-project/commit/68d5235cb58f988c71b403334cd9482d663841ab.patch
-
https://reviews.llvm.org/D102059
-
--- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-
+++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-
@@ -370,15 +370,6 @@ static void ioctl_table_fill() {
-
-
#if SANITIZER_GLIBC
-
// _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
-
- _(CYGETDEFTHRESH, WRITE, sizeof(int));
-
- _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
-
- _(CYGETMON, WRITE, struct_cyclades_monitor_sz);
-
- _(CYGETTHRESH, WRITE, sizeof(int));
-
- _(CYGETTIMEOUT, WRITE, sizeof(int));
-
- _(CYSETDEFTHRESH, NONE, 0);
-
- _(CYSETDEFTIMEOUT, NONE, 0);
-
- _(CYSETTHRESH, NONE, 0);
-
- _(CYSETTIMEOUT, NONE, 0);
-
_(EQL_EMANCIPATE, WRITE, struct_ifreq_sz);
-
_(EQL_ENSLAVE, WRITE, struct_ifreq_sz);
-
_(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz);
-
--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-
+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-
@@ -143,7 +143,6 @@ typedef struct user_fpregs elf_fpregset_t;
-
# include <sys/procfs.h>
-
#endif
-
#include <sys/user.h>
-
-#include <linux/cyclades.h>
-
#include <linux/if_eql.h>
-
#include <linux/if_plip.h>
-
#include <linux/lp.h>
-
@@ -460,7 +459,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
-
-
#if SANITIZER_GLIBC
-
unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
-
- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
-
#if EV_VERSION > (0x010000)
-
unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry);
-
#else
-
@@ -824,15 +822,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
-
#endif // SANITIZER_LINUX
-
-
#if SANITIZER_LINUX && !SANITIZER_ANDROID
-
- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
-
- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
-
- unsigned IOCTL_CYGETMON = CYGETMON;
-
- unsigned IOCTL_CYGETTHRESH = CYGETTHRESH;
-
- unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT;
-
- unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH;
-
- unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;
-
- unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;
-
- unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;
-
unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE;
-
unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE;
-
unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;
-
--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h
-
+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
-
@@ -983,7 +983,6 @@ extern unsigned struct_vt_mode_sz;
-
-
#if SANITIZER_LINUX && !SANITIZER_ANDROID
-
extern unsigned struct_ax25_parms_struct_sz;
-
- extern unsigned struct_cyclades_monitor_sz;
-
extern unsigned struct_input_keymap_entry_sz;
-
extern unsigned struct_ipx_config_data_sz;
-
extern unsigned struct_kbdiacrs_sz;
-
@@ -1328,15 +1327,6 @@ extern unsigned IOCTL_VT_WAITACTIVE;
-
#endif // SANITIZER_LINUX
-
-
#if SANITIZER_LINUX && !SANITIZER_ANDROID
-
- extern unsigned IOCTL_CYGETDEFTHRESH;
-
- extern unsigned IOCTL_CYGETDEFTIMEOUT;
-
- extern unsigned IOCTL_CYGETMON;
-
- extern unsigned IOCTL_CYGETTHRESH;
-
- extern unsigned IOCTL_CYGETTIMEOUT;
-
- extern unsigned IOCTL_CYSETDEFTHRESH;
-
- extern unsigned IOCTL_CYSETDEFTIMEOUT;
-
- extern unsigned IOCTL_CYSETTHRESH;
-
- extern unsigned IOCTL_CYSETTIMEOUT;
-
extern unsigned IOCTL_EQL_EMANCIPATE;
-
extern unsigned IOCTL_EQL_ENSLAVE;
-
extern unsigned IOCTL_EQL_GETMASTRCFG;
+120 -232
pkgs/development/compilers/llvm/common/default.nix
···
tools:
let
callPackage = newScope (tools // args // metadata);
-
clangVersion =
-
if (lib.versionOlder metadata.release_version "16") then
-
metadata.release_version
-
else
-
lib.versions.major metadata.release_version;
+
clangVersion = lib.versions.major metadata.release_version;
mkExtraBuildCommands0 =
cc:
''
···
# to replacements depending on the llvm outpath (e.g. the LLVMgold patch).
# So take the only patch known to be necessary.
(metadata.getVersionFile "clang/gnu-install-dirs.patch")
-
]
-
++
-
lib.optional (stdenv.isAarch64 && lib.versions.major metadata.release_version == "17")
-
# Fixes llvm17 tblgen builds on aarch64.
-
# https://github.com/llvm/llvm-project/issues/106521#issuecomment-2337175680
-
(metadata.getVersionFile "clang/aarch64-tblgen.patch");
+
];
};
libclang = callPackage ./clang {
···
lib.recurseIntoAttrs { llef = callPackage ./lldb-plugins/llef.nix { }; }
);
-
lldb = callPackage ./lldb (
-
{
-
}
-
// lib.optionalAttrs (lib.versions.major metadata.release_version == "16") {
-
src = callPackage (
-
{ runCommand }:
-
runCommand "lldb-src-${metadata.version}" { } ''
-
mkdir -p "$out"
-
cp -r ${monorepoSrc}/cmake "$out"
-
cp -r ${monorepoSrc}/lldb "$out"
-
''
-
) { };
+
lldb = callPackage ./lldb { };
+
+
lldb-manpages = lowPrio (
+
tools.lldb.override {
+
enableManpages = true;
+
python3 = pkgs.python3; # don't use python-boot
}
);
···
bintools = wrapBintoolsWith { bintools = tools.bintools-unwrapped; };
-
clangUseLLVM = wrapCCWith (
-
rec {
-
cc = tools.clang-unwrapped;
-
libcxx = targetLlvmLibraries.libcxx;
-
bintools = bintools';
-
extraPackages = [
-
targetLlvmLibraries.compiler-rt
-
]
-
++ lib.optionals (!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD) [
-
targetLlvmLibraries.libunwind
-
];
-
extraBuildCommands =
-
lib.optionalString (lib.versions.major metadata.release_version == "13") (
-
''
-
echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags
-
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
-
''
-
+ lib.optionalString (!stdenv.targetPlatform.isWasm) ''
-
echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags
-
echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags
-
''
-
+ lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) ''
-
echo "-lunwind" >> $out/nix-support/cc-ldflags
-
''
-
+ lib.optionalString stdenv.targetPlatform.isWasm ''
-
echo "-fno-exceptions" >> $out/nix-support/cc-cflags
-
''
-
)
-
+ mkExtraBuildCommands cc;
-
}
-
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") {
-
nixSupport.cc-cflags = [
-
"-rtlib=compiler-rt"
-
"-Wno-unused-command-line-argument"
-
"-B${targetLlvmLibraries.compiler-rt}/lib"
-
]
-
++ lib.optional (
-
!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD
-
) "--unwindlib=libunwind"
-
++ lib.optional (
-
!stdenv.targetPlatform.isWasm
-
&& !stdenv.targetPlatform.isFreeBSD
-
&& stdenv.targetPlatform.useLLVM or false
-
) "-lunwind"
-
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
-
nixSupport.cc-ldflags = lib.optionals (
-
!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD
-
) [ "-L${targetLlvmLibraries.libunwind}/lib" ];
-
}
-
);
+
clangUseLLVM = wrapCCWith rec {
+
cc = tools.clang-unwrapped;
+
libcxx = targetLlvmLibraries.libcxx;
+
bintools = bintools';
+
extraPackages = [
+
targetLlvmLibraries.compiler-rt
+
]
+
++ lib.optionals (!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD) [
+
targetLlvmLibraries.libunwind
+
];
+
extraBuildCommands = mkExtraBuildCommands cc;
+
nixSupport.cc-cflags = [
+
"-rtlib=compiler-rt"
+
"-Wno-unused-command-line-argument"
+
"-B${targetLlvmLibraries.compiler-rt}/lib"
+
]
+
++ lib.optional (
+
!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD
+
) "--unwindlib=libunwind"
+
++ lib.optional (
+
!stdenv.targetPlatform.isWasm
+
&& !stdenv.targetPlatform.isFreeBSD
+
&& stdenv.targetPlatform.useLLVM or false
+
) "-lunwind"
+
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
+
nixSupport.cc-ldflags = lib.optionals (
+
!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD
+
) [ "-L${targetLlvmLibraries.libunwind}/lib" ];
+
};
-
clangWithLibcAndBasicRtAndLibcxx = wrapCCWith (
-
rec {
-
cc = tools.clang-unwrapped;
-
libcxx = targetLlvmLibraries.libcxx;
-
bintools = bintools';
-
extraPackages = [
-
targetLlvmLibraries.compiler-rt-no-libc
-
]
-
++
-
lib.optionals
-
(
-
!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin
-
)
-
[
-
targetLlvmLibraries.libunwind
-
];
-
extraBuildCommands =
-
lib.optionalString (lib.versions.major metadata.release_version == "13") (
-
''
-
echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags
-
echo "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" >> $out/nix-support/cc-cflags
-
''
-
+ lib.optionalString (!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isDarwin) ''
-
echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags
-
echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags
-
''
-
+ lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) ''
-
echo "-lunwind" >> $out/nix-support/cc-ldflags
-
''
-
+ lib.optionalString stdenv.targetPlatform.isWasm ''
-
echo "-fno-exceptions" >> $out/nix-support/cc-cflags
-
''
+
clangWithLibcAndBasicRtAndLibcxx = wrapCCWith rec {
+
cc = tools.clang-unwrapped;
+
libcxx = targetLlvmLibraries.libcxx;
+
bintools = bintools';
+
extraPackages = [
+
targetLlvmLibraries.compiler-rt-no-libc
+
]
+
++
+
lib.optionals
+
(
+
!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin
)
-
+ mkExtraBuildCommandsBasicRt cc;
-
}
-
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") {
-
nixSupport.cc-cflags = [
-
"-rtlib=compiler-rt"
-
"-Wno-unused-command-line-argument"
-
"-B${targetLlvmLibraries.compiler-rt-no-libc}/lib"
-
]
-
++ lib.optional (
-
!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin
-
) "--unwindlib=libunwind"
-
++ lib.optional (
-
!stdenv.targetPlatform.isWasm
-
&& !stdenv.targetPlatform.isFreeBSD
-
&& stdenv.targetPlatform.useLLVM or false
-
) "-lunwind"
-
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
-
nixSupport.cc-ldflags = lib.optionals (
-
!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin
-
) [ "-L${targetLlvmLibraries.libunwind}/lib" ];
-
}
-
);
+
[
+
targetLlvmLibraries.libunwind
+
];
+
extraBuildCommands = mkExtraBuildCommandsBasicRt cc;
+
nixSupport.cc-cflags = [
+
"-rtlib=compiler-rt"
+
"-Wno-unused-command-line-argument"
+
"-B${targetLlvmLibraries.compiler-rt-no-libc}/lib"
+
]
+
++ lib.optional (
+
!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin
+
) "--unwindlib=libunwind"
+
++ lib.optional (
+
!stdenv.targetPlatform.isWasm
+
&& !stdenv.targetPlatform.isFreeBSD
+
&& stdenv.targetPlatform.useLLVM or false
+
) "-lunwind"
+
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
+
nixSupport.cc-ldflags = lib.optionals (
+
!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin
+
) [ "-L${targetLlvmLibraries.libunwind}/lib" ];
+
};
-
clangWithLibcAndBasicRt = wrapCCWith (
-
rec {
-
cc = tools.clang-unwrapped;
-
libcxx = null;
-
bintools = bintools';
-
extraPackages = [ targetLlvmLibraries.compiler-rt-no-libc ];
-
extraBuildCommands =
-
lib.optionalString (lib.versions.major metadata.release_version == "13") ''
-
echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags
-
echo "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" >> $out/nix-support/cc-cflags
-
echo "-nostdlib++" >> $out/nix-support/cc-cflags
-
''
-
+ mkExtraBuildCommandsBasicRt cc;
-
}
-
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") {
-
nixSupport.cc-cflags = [
-
"-rtlib=compiler-rt"
-
"-B${targetLlvmLibraries.compiler-rt-no-libc}/lib"
-
"-nostdlib++"
-
]
-
++ lib.optional (
-
lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm
-
) "-fno-exceptions";
-
}
-
);
+
clangWithLibcAndBasicRt = wrapCCWith rec {
+
cc = tools.clang-unwrapped;
+
libcxx = null;
+
bintools = bintools';
+
extraPackages = [ targetLlvmLibraries.compiler-rt-no-libc ];
+
extraBuildCommands = mkExtraBuildCommandsBasicRt cc;
+
nixSupport.cc-cflags = [
+
"-rtlib=compiler-rt"
+
"-B${targetLlvmLibraries.compiler-rt-no-libc}/lib"
+
"-nostdlib++"
+
]
+
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
+
};
-
clangNoLibcWithBasicRt = wrapCCWith (
-
rec {
-
cc = tools.clang-unwrapped;
-
libcxx = null;
-
bintools = bintoolsNoLibc';
-
extraPackages = [ targetLlvmLibraries.compiler-rt-no-libc ];
-
extraBuildCommands =
-
lib.optionalString (lib.versions.major metadata.release_version == "13") ''
-
echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags
-
echo "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" >> $out/nix-support/cc-cflags
-
''
-
+ mkExtraBuildCommandsBasicRt cc;
-
}
-
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") {
-
nixSupport.cc-cflags = [
-
"-rtlib=compiler-rt"
-
"-B${targetLlvmLibraries.compiler-rt-no-libc}/lib"
-
]
-
++ lib.optional (
-
lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm
-
) "-fno-exceptions";
-
}
-
);
+
clangNoLibcWithBasicRt = wrapCCWith rec {
+
cc = tools.clang-unwrapped;
+
libcxx = null;
+
bintools = bintoolsNoLibc';
+
extraPackages = [ targetLlvmLibraries.compiler-rt-no-libc ];
+
extraBuildCommands = mkExtraBuildCommandsBasicRt cc;
+
nixSupport.cc-cflags = [
+
"-rtlib=compiler-rt"
+
"-B${targetLlvmLibraries.compiler-rt-no-libc}/lib"
+
]
+
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
+
};
-
clangNoLibcNoRt = wrapCCWith (
-
rec {
-
cc = tools.clang-unwrapped;
-
libcxx = null;
-
bintools = bintoolsNoLibc';
-
extraPackages = [ ];
-
# "-nostartfiles" used to be needed for pkgsLLVM, causes problems so don't include it.
-
extraBuildCommands = mkExtraBuildCommands0 cc;
-
}
-
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") {
-
# "-nostartfiles" used to be needed for pkgsLLVM, causes problems so don't include it.
-
nixSupport.cc-cflags = lib.optional (
-
lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm
-
) "-fno-exceptions";
-
}
-
);
+
clangNoLibcNoRt = wrapCCWith rec {
+
cc = tools.clang-unwrapped;
+
libcxx = null;
+
bintools = bintoolsNoLibc';
+
extraPackages = [ ];
+
# "-nostartfiles" used to be needed for pkgsLLVM, causes problems so don't include it.
+
extraBuildCommands = mkExtraBuildCommands0 cc;
+
nixSupport.cc-cflags = lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
+
};
# This is an "oddly ordered" bootstrap just for Darwin. Probably
# don't want it otherwise.
···
extraPackages = [ ];
extraBuildCommands = mkExtraBuildCommands0 cc;
}
-
// lib.optionalAttrs (
-
lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm
-
) { nixSupport.cc-cflags = [ "-fno-exceptions" ]; };
+
# FIXME: This should be inside the `wrapCCWith` call.
+
// lib.optionalAttrs stdenv.targetPlatform.isWasm {
+
nixSupport.cc-cflags = [ "-fno-exceptions" ];
+
};
# Aliases
clangNoCompilerRt = tools.clangNoLibcNoRt;
clangNoLibc = tools.clangNoLibcWithBasicRt;
clangNoLibcxx = tools.clangWithLibcAndBasicRt;
-
}
-
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "15") {
-
# TODO: pre-15: lldb/docs/index.rst:155:toctree contains reference to nonexisting document 'design/structureddataplugins'
-
lldb-manpages = lowPrio (
-
tools.lldb.override {
-
enableManpages = true;
-
python3 = pkgs.python3; # don't use python-boot
-
}
-
);
-
}
-
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "16") {
+
mlir = callPackage ./mlir { };
}
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "19") {
bolt = callPackage ./bolt {
};
}
-
//
-
lib.optionalAttrs
-
(lib.versionAtLeast metadata.release_version "16" && lib.versionOlder metadata.release_version "22")
-
{
-
libclc = callPackage ./libclc { };
-
}
+
// lib.optionalAttrs (lib.versionOlder metadata.release_version "22") {
+
libclc = callPackage ./libclc { };
+
}
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "20") {
flang = callPackage ./flang {
mlir = tools.mlir;
···
libraries = lib.makeExtensible (
libraries:
let
-
callPackage = newScope (
-
libraries
-
// buildLlvmTools
-
// args
-
// metadata
-
# Previously monorepoSrc was erroneously not being passed through.
-
// lib.optionalAttrs (lib.versionOlder metadata.release_version "14") { monorepoSrc = null; } # Preserve a bug during #307211, TODO: remove; causes llvm 13 rebuild.
-
);
+
callPackage = newScope (libraries // buildLlvmTools // args // metadata);
in
(
{
···
libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
-
libcxx = callPackage ./libcxx (
-
{
-
stdenv =
-
if stdenv.hostPlatform.isDarwin then
-
overrideCC darwin.bootstrapStdenv buildLlvmTools.clangWithLibcAndBasicRt
-
else
-
overrideCC stdenv buildLlvmTools.clangWithLibcAndBasicRt;
-
}
-
// lib.optionalAttrs (lib.versionOlder metadata.release_version "14") {
-
# TODO: remove this, causes LLVM 13 packages rebuild.
-
inherit (metadata) monorepoSrc; # Preserve bug during #307211 refactor.
-
}
-
);
+
libcxx = callPackage ./libcxx {
+
stdenv =
+
if stdenv.hostPlatform.isDarwin then
+
overrideCC darwin.bootstrapStdenv buildLlvmTools.clangWithLibcAndBasicRt
+
else
+
overrideCC stdenv buildLlvmTools.clangWithLibcAndBasicRt;
+
};
libunwind = callPackage ./libunwind {
stdenv = overrideCC stdenv buildLlvmTools.clangWithLibcAndBasicRt;
+1 -1
pkgs/development/compilers/llvm/common/libc/default.nix
···
nativeBuildInputs = [
cmake
python3
+
ninja
]
-
++ (lib.optional (lib.versionAtLeast release_version "15") ninja)
++ (lib.optional isFullBuild python3Packages.pyyaml);
buildInputs = lib.optional isFullBuild linuxHeaders;
+5 -11
pkgs/development/compilers/llvm/common/libclc/default.nix
···
pname = "libclc";
inherit version;
-
src = runCommand "libclc-src-${version}" { inherit (monorepoSrc) passthru; } (
-
''
-
mkdir -p "$out"
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "14") ''
-
cp -r ${monorepoSrc}/cmake "$out"
-
''
-
+ ''
-
cp -r ${monorepoSrc}/libclc "$out"
-
''
-
);
+
src = runCommand "libclc-src-${version}" { inherit (monorepoSrc) passthru; } (''
+
mkdir -p "$out"
+
cp -r ${monorepoSrc}/cmake "$out"
+
cp -r ${monorepoSrc}/libclc "$out"
+
'');
sourceRoot = "${finalAttrs.src.name}/libclc";
+125 -206
pkgs/development/compilers/llvm/common/libcxx/default.nix
···
# Note: useLLVM is likely false for Darwin but true under pkgsLLVM
useLLVM = stdenv.hostPlatform.useLLVM or false;
-
cxxabiCMakeFlags =
-
lib.optionals (lib.versionAtLeast release_version "18") [
-
(lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" false)
-
]
-
++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm) (
-
if lib.versionAtLeast release_version "18" then
-
[
-
(lib.cmakeFeature "LIBCXXABI_ADDITIONAL_LIBRARIES" "unwind")
-
(lib.cmakeBool "LIBCXXABI_USE_COMPILER_RT" true)
-
]
-
else
-
[
-
(lib.cmakeBool "LIBCXXABI_USE_COMPILER_RT" true)
-
(lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" true)
-
]
-
)
-
++ lib.optionals stdenv.hostPlatform.isWasm [
-
(lib.cmakeBool "LIBCXXABI_ENABLE_THREADS" false)
-
(lib.cmakeBool "LIBCXXABI_ENABLE_EXCEPTIONS" false)
-
]
-
++ lib.optionals (!enableShared || stdenv.hostPlatform.isWindows) [
-
# Required on Windows due to https://github.com/llvm/llvm-project/issues/55245
-
(lib.cmakeBool "LIBCXXABI_ENABLE_SHARED" false)
-
];
+
cxxabiCMakeFlags = [
+
(lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" false)
+
]
+
++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm) [
+
(lib.cmakeFeature "LIBCXXABI_ADDITIONAL_LIBRARIES" "unwind")
+
(lib.cmakeBool "LIBCXXABI_USE_COMPILER_RT" true)
+
]
+
++ lib.optionals stdenv.hostPlatform.isWasm [
+
(lib.cmakeBool "LIBCXXABI_ENABLE_THREADS" false)
+
(lib.cmakeBool "LIBCXXABI_ENABLE_EXCEPTIONS" false)
+
]
+
++ lib.optionals (!enableShared || stdenv.hostPlatform.isWindows) [
+
# Required on Windows due to https://github.com/llvm/llvm-project/issues/55245
+
(lib.cmakeBool "LIBCXXABI_ENABLE_SHARED" false)
+
];
cxxCMakeFlags = [
(lib.cmakeFeature "LIBCXX_CXX_ABI" cxxabiName)
···
# https://github.com/llvm/llvm-project/issues/55245
(lib.cmakeBool "LIBCXX_ENABLE_STATIC_ABI_LIBRARY" stdenv.hostPlatform.isWindows)
]
-
++ lib.optionals (cxxabi == null && lib.versionAtLeast release_version "16") [
-
# Note: llvm < 16 doesn't support this flag (or it's broken); handled in postInstall instead.
+
++ lib.optionals (cxxabi == null) [
# Include libc++abi symbols within libc++.a for static linking libc++;
# dynamic linking includes them through libc++.so being a linker script
# which includes both shared objects.
···
(lib.cmakeFeature "LIBCXX_HAS_MUSL_LIBC" "1")
]
++
-
lib.optionals
-
(
-
lib.versionAtLeast release_version "18"
-
&& !useLLVM
-
&& stdenv.hostPlatform.libc == "glibc"
-
&& !stdenv.hostPlatform.isStatic
-
)
+
lib.optionals (!useLLVM && stdenv.hostPlatform.libc == "glibc" && !stdenv.hostPlatform.isStatic)
[
(lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "gcc_s")
]
-
++ lib.optionals (lib.versionAtLeast release_version "18" && stdenv.hostPlatform.isFreeBSD) [
+
++ lib.optionals stdenv.hostPlatform.isFreeBSD [
# Name and documentation claim this is for libc++abi, but its man effect is adding `-lunwind`
# to the libc++.so linker script. We want FreeBSD's so-called libgcc instead of libunwind.
(lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" false)
···
++ lib.optionals useLLVM [
(lib.cmakeBool "LIBCXX_USE_COMPILER_RT" true)
]
-
++
-
lib.optionals (useLLVM && !stdenv.hostPlatform.isFreeBSD && lib.versionAtLeast release_version "16")
-
[
-
(lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "unwind")
-
]
+
++ lib.optionals (useLLVM && !stdenv.hostPlatform.isFreeBSD) [
+
(lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "unwind")
+
]
++ lib.optionals stdenv.hostPlatform.isWasm [
(lib.cmakeBool "LIBCXX_ENABLE_THREADS" false)
(lib.cmakeBool "LIBCXX_ENABLE_FILESYSTEM" false)
···
cmakeFlags = [
(lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" (lib.concatStringsSep ";" runtimes))
]
-
++
-
lib.optionals
-
(
-
stdenv.hostPlatform.isWasm
-
|| (lib.versions.major release_version == "12" && stdenv.hostPlatform.isDarwin)
-
)
-
[
-
(lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true)
-
]
++ lib.optionals stdenv.hostPlatform.isWasm [
+
(lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true)
(lib.cmakeBool "CMAKE_C_COMPILER_WORKS" true)
(lib.cmakeBool "UNIX" true) # Required otherwise libc++ fails to detect the correct linker
]
···
in
-
stdenv.mkDerivation (
-
finalAttrs:
-
{
-
pname = "libcxx";
-
inherit version cmakeFlags;
+
stdenv.mkDerivation (finalAttrs: {
+
pname = "libcxx";
+
inherit version cmakeFlags;
-
src =
-
if monorepoSrc != null then
-
runCommand "libcxx-src-${version}" { inherit (monorepoSrc) passthru; } (
-
''
-
mkdir -p "$out/llvm"
-
''
-
+ (lib.optionalString (lib.versionAtLeast release_version "14") ''
-
cp -r ${monorepoSrc}/cmake "$out"
-
'')
-
+ ''
-
cp -r ${monorepoSrc}/libcxx "$out"
-
cp -r ${monorepoSrc}/llvm/cmake "$out/llvm"
-
cp -r ${monorepoSrc}/llvm/utils "$out/llvm"
-
''
-
+ (lib.optionalString (lib.versionAtLeast release_version "14") ''
-
cp -r ${monorepoSrc}/third-party "$out"
-
'')
-
+ (lib.optionalString (lib.versionAtLeast release_version "20") ''
-
cp -r ${monorepoSrc}/libc "$out"
-
'')
-
+ ''
-
cp -r ${monorepoSrc}/runtimes "$out"
-
''
-
+ (lib.optionalString (cxxabi == null) ''
-
cp -r ${monorepoSrc}/libcxxabi "$out"
-
'')
-
)
-
else
-
src;
+
src =
+
if monorepoSrc != null then
+
runCommand "libcxx-src-${version}" { inherit (monorepoSrc) passthru; } (
+
''
+
mkdir -p "$out/llvm"
+
cp -r ${monorepoSrc}/cmake "$out"
+
cp -r ${monorepoSrc}/libcxx "$out"
+
cp -r ${monorepoSrc}/llvm/cmake "$out/llvm"
+
cp -r ${monorepoSrc}/llvm/utils "$out/llvm"
+
cp -r ${monorepoSrc}/third-party "$out"
+
''
+
+ (lib.optionalString (lib.versionAtLeast release_version "20") ''
+
cp -r ${monorepoSrc}/libc "$out"
+
'')
+
+ ''
+
cp -r ${monorepoSrc}/runtimes "$out"
+
''
+
+ (lib.optionalString (cxxabi == null) ''
+
cp -r ${monorepoSrc}/libcxxabi "$out"
+
'')
+
)
+
else
+
src;
+
+
outputs = [
+
"out"
+
"dev"
+
];
-
outputs = [
-
"out"
-
"dev"
-
];
+
preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
+
patchShebangs utils/cat_files.py
+
'';
-
preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
-
patchShebangs utils/cat_files.py
-
'';
+
# TODO: Remove on `staging`.
+
patches = [ ];
-
patches = lib.optionals (lib.versionOlder release_version "16") (
-
lib.optional (lib.versions.major release_version == "15")
-
# See:
-
# - https://reviews.llvm.org/D133566
-
# - https://github.com/NixOS/nixpkgs/issues/214524#issuecomment-1429146432
-
# !!! Drop in LLVM 16+
-
(
-
fetchpatch {
-
url = "https://github.com/llvm/llvm-project/commit/57c7bb3ec89565c68f858d316504668f9d214d59.patch";
-
hash = "sha256-B07vHmSjy5BhhkGSj3e1E0XmMv5/9+mvC/k70Z29VwY=";
-
}
-
)
-
++ [
-
(substitute {
-
src = ../libcxxabi/wasm.patch;
-
substitutions = [
-
"--replace-fail"
-
"/cmake/"
-
"/llvm/cmake/"
-
];
-
})
-
]
-
++ lib.optional stdenv.hostPlatform.isMusl (substitute {
-
src = ./libcxx-0001-musl-hacks.patch;
-
substitutions = [
-
"--replace-fail"
-
"/include/"
-
"/libcxx/include/"
-
];
-
})
-
);
+
nativeBuildInputs = [
+
cmake
+
ninja
+
python3
+
]
+
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames
+
++ lib.optional (cxxabi != null) lndir;
-
nativeBuildInputs = [
-
cmake
-
ninja
-
python3
-
]
-
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames
-
++ lib.optional (cxxabi != null) lndir;
+
buildInputs = [
+
cxxabi
+
]
+
++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm && !stdenv.hostPlatform.isFreeBSD) [
+
libunwind
+
];
-
buildInputs = [
-
cxxabi
-
]
-
++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm && !stdenv.hostPlatform.isFreeBSD) [
-
libunwind
-
];
+
# TODO: Possibly move back to `sourceRoot` on `staging`?
+
postPatch = ''
+
cd runtimes
+
'';
-
# libc++.so is a linker script which expands to multiple libraries,
-
# libc++.so.1 and libc++abi.so or the external cxxabi. ld-wrapper doesn't
-
# support linker scripts so the external cxxabi needs to be symlinked in
-
postInstall =
-
lib.optionalString (cxxabi != null) ''
-
lndir ${lib.getDev cxxabi}/include $dev/include/c++/v1
-
lndir ${lib.getLib cxxabi}/lib $out/lib
-
libcxxabi=$out/lib/lib${cxxabi.libName}.a
-
''
-
# LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON doesn't work for LLVM < 16 or
-
# external cxxabi libraries so merge libc++abi.a into libc++.a ourselves.
+
# libc++.so is a linker script which expands to multiple libraries,
+
# libc++.so.1 and libc++abi.so or the external cxxabi. ld-wrapper doesn't
+
# support linker scripts so the external cxxabi needs to be symlinked in
+
postInstall =
+
lib.optionalString (cxxabi != null) ''
+
lndir ${lib.getDev cxxabi}/include $dev/include/c++/v1
+
lndir ${lib.getLib cxxabi}/lib $out/lib
+
libcxxabi=$out/lib/lib${cxxabi.libName}.a
+
''
+
# LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON doesn't work for
+
# external cxxabi libraries so merge libc++abi.a into libc++.a ourselves.
-
# GNU binutils emits objects in LIFO order in MRI scripts so after the merge
-
# the objects are in reversed order so a second MRI script is required so the
-
# objects in the archive are listed in proper order (libc++.a, libc++abi.a)
-
+ lib.optionalString (cxxabi != null || lib.versionOlder release_version "16") ''
-
libcxxabi=''${libcxxabi-$out/lib/libc++abi.a}
-
if [[ -f $out/lib/libc++.a && -e $libcxxabi ]]; then
-
$AR -M <<MRI
-
create $out/lib/libc++.a
-
addlib $out/lib/libc++.a
-
addlib $libcxxabi
-
save
-
end
-
MRI
-
$AR -M <<MRI
-
create $out/lib/libc++.a
-
addlib $out/lib/libc++.a
-
save
-
end
-
MRI
-
fi
-
'';
+
# GNU binutils emits objects in LIFO order in MRI scripts so after the merge
+
# the objects are in reversed order so a second MRI script is required so the
+
# objects in the archive are listed in proper order (libc++.a, libc++abi.a)
+
+ lib.optionalString (cxxabi != null) ''
+
libcxxabi=''${libcxxabi-$out/lib/libc++abi.a}
+
if [[ -f $out/lib/libc++.a && -e $libcxxabi ]]; then
+
$AR -M <<MRI
+
create $out/lib/libc++.a
+
addlib $out/lib/libc++.a
+
addlib $libcxxabi
+
save
+
end
+
MRI
+
$AR -M <<MRI
+
create $out/lib/libc++.a
+
addlib $out/lib/libc++.a
+
save
+
end
+
MRI
+
fi
+
'';
-
passthru = {
-
isLLVM = true;
-
};
+
passthru = {
+
isLLVM = true;
+
};
-
meta = llvm_meta // {
-
homepage = "https://libcxx.llvm.org/";
-
description = "C++ standard library";
-
longDescription = ''
-
libc++ is an implementation of the C++ standard library, targeting C++11,
-
C++14 and above.
-
'';
-
# "All of the code in libc++ is dual licensed under the MIT license and the
-
# UIUC License (a BSD-like license)":
-
license = with lib.licenses; [
-
mit
-
ncsa
-
];
-
};
-
}
-
// (
-
if (lib.versionOlder release_version "16" || lib.versionAtLeast release_version "17") then
-
{
-
postPatch =
-
(lib.optionalString
-
(lib.versionAtLeast release_version "14" && lib.versionOlder release_version "15")
-
''
-
# fix CMake error when static and LIBCXXABI_USE_LLVM_UNWINDER=ON. aren't
-
# building unwind so don't need to depend on it
-
substituteInPlace libcxx/src/CMakeLists.txt \
-
--replace-fail "add_dependencies(cxx_static unwind)" "# add_dependencies(cxx_static unwind)"
-
''
-
)
-
+ ''
-
cd runtimes
-
'';
-
}
-
else
-
{
-
sourceRoot = "${finalAttrs.src.name}/runtimes";
-
}
-
)
-
)
+
meta = llvm_meta // {
+
homepage = "https://libcxx.llvm.org/";
+
description = "C++ standard library";
+
longDescription = ''
+
libc++ is an implementation of the C++ standard library, targeting C++11,
+
C++14 and above.
+
'';
+
# "All of the code in libc++ is dual licensed under the MIT license and the
+
# UIUC License (a BSD-like license)":
+
license = with lib.licenses; [
+
mit
+
ncsa
+
];
+
};
+
})
-39
pkgs/development/compilers/llvm/common/libcxx/libcxx-0001-musl-hacks.patch
···
-
From 1c936d7fda3275265e37f93697232a1ed652390f Mon Sep 17 00:00:00 2001
-
From: Will Dietz <w@wdtz.org>
-
Date: Sat, 9 Jul 2016 19:22:54 -0500
-
Subject: [PATCH] musl fixes/hacks
-
-
Conflicts:
-
-
include/__config
-
include/locale
-
src/locale.cpp
-
---
-
include/locale | 4 ++--
-
1 files changed, 2 insertions(+), 2 deletions(-)
-
-
diff --git a/include/locale b/include/locale
-
index 3d804e8..9b01f5b 100644
-
--- a/include/locale
-
+++ b/include/locale
-
@@ -695,7 +695,7 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
-
typename remove_reference<decltype(errno)>::type __save_errno = errno;
-
errno = 0;
-
char *__p2;
-
- long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
-
+ long long __ll = strtoll(__a, &__p2, __base);
-
typename remove_reference<decltype(errno)>::type __current_errno = errno;
-
if (__current_errno == 0)
-
errno = __save_errno;
-
@@ -735,7 +735,7 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
-
typename remove_reference<decltype(errno)>::type __save_errno = errno;
-
errno = 0;
-
char *__p2;
-
- unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
-
+ unsigned long long __ll = strtoull(__a, &__p2, __base);
-
typename remove_reference<decltype(errno)>::type __current_errno = errno;
-
if (__current_errno == 0)
-
errno = __save_errno;
-
--
-
1.7.1
-
-16
pkgs/development/compilers/llvm/common/libcxxabi/wasm.patch
···
-
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
-
index 15497d405e0..33f7f18193a 100644
-
--- a/cmake/modules/HandleLLVMOptions.cmake
-
+++ b/cmake/modules/HandleLLVMOptions.cmake
-
@@ -127,7 +127,10 @@ else(WIN32)
-
set(LLVM_HAVE_LINK_VERSION_SCRIPT 1)
-
endif()
-
else(FUCHSIA OR UNIX)
-
- MESSAGE(SEND_ERROR "Unable to determine platform")
-
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Wasi")
-
+ else()
-
+ MESSAGE(SEND_ERROR "Unable to determine platform")
-
+ endif()
-
endif(FUCHSIA OR UNIX)
-
endif(WIN32)
-
+65 -102
pkgs/development/compilers/llvm/common/libunwind/default.nix
···
devExtraCmakeFlags ? [ ],
getVersionFile,
}:
-
stdenv.mkDerivation (
-
finalAttrs:
-
let
-
hasPatches = builtins.length finalAttrs.patches > 0;
-
in
-
{
-
pname = "libunwind";
+
stdenv.mkDerivation (finalAttrs: {
+
pname = "libunwind";
-
inherit version;
+
inherit version;
-
patches = lib.optional (lib.versionOlder release_version "17") (
-
getVersionFile "libunwind/gnu-install-dirs.patch"
-
);
+
# TODO: Remove on `staging`.
+
patches = [ ];
-
src =
-
if monorepoSrc != null then
-
runCommand "libunwind-src-${version}" { inherit (monorepoSrc) passthru; } (
-
''
-
mkdir -p "$out"
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "14") ''
-
cp -r ${monorepoSrc}/cmake "$out"
-
''
-
+ ''
-
cp -r ${monorepoSrc}/libunwind "$out"
-
mkdir -p "$out/libcxx"
-
cp -r ${monorepoSrc}/libcxx/cmake "$out/libcxx"
-
cp -r ${monorepoSrc}/libcxx/utils "$out/libcxx"
-
mkdir -p "$out/llvm"
-
cp -r ${monorepoSrc}/llvm/cmake "$out/llvm"
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "15") ''
-
cp -r ${monorepoSrc}/llvm/utils "$out/llvm"
-
cp -r ${monorepoSrc}/runtimes "$out"
-
''
-
)
-
else
-
src;
+
src =
+
if monorepoSrc != null then
+
runCommand "libunwind-src-${version}" { inherit (monorepoSrc) passthru; } ''
+
mkdir -p "$out"
+
cp -r ${monorepoSrc}/cmake "$out"
+
cp -r ${monorepoSrc}/libunwind "$out"
+
mkdir -p "$out/libcxx"
+
cp -r ${monorepoSrc}/libcxx/cmake "$out/libcxx"
+
cp -r ${monorepoSrc}/libcxx/utils "$out/libcxx"
+
mkdir -p "$out/llvm"
+
cp -r ${monorepoSrc}/llvm/cmake "$out/llvm"
+
cp -r ${monorepoSrc}/llvm/utils "$out/llvm"
+
cp -r ${monorepoSrc}/runtimes "$out"
+
''
+
else
+
src;
-
sourceRoot =
-
if lib.versionAtLeast release_version "15" then
-
"${finalAttrs.src.name}/runtimes"
-
else
-
"${finalAttrs.src.name}/libunwind";
+
sourceRoot = "${finalAttrs.src.name}/runtimes";
-
outputs = [
-
"out"
-
"dev"
-
];
+
outputs = [
+
"out"
+
"dev"
+
];
-
nativeBuildInputs = [
-
cmake
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "15") [
-
ninja
-
python3
-
];
+
nativeBuildInputs = [
+
cmake
+
ninja
+
python3
+
];
-
cmakeFlags = [
-
(lib.cmakeBool "LIBUNWIND_ENABLE_SHARED" enableShared)
-
]
-
++ lib.optional (lib.versionAtLeast release_version "15") (
-
lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "libunwind"
-
)
-
++ lib.optionals (lib.versions.major release_version == "12" && stdenv.hostPlatform.isDarwin) [
-
(lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true)
-
]
-
++ devExtraCmakeFlags;
-
-
prePatch =
-
lib.optionalString
-
(lib.versionAtLeast release_version "15" && (hasPatches || lib.versionOlder release_version "18"))
-
''
-
cd ../libunwind
-
chmod -R u+w .
-
'';
+
cmakeFlags = [
+
(lib.cmakeBool "LIBUNWIND_ENABLE_SHARED" enableShared)
+
(lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "libunwind")
+
]
+
++ devExtraCmakeFlags;
-
postPatch =
-
lib.optionalString
-
(lib.versionAtLeast release_version "15" && (hasPatches || lib.versionOlder release_version "18"))
-
''
-
cd ../runtimes
-
'';
+
# TODO: Remove on `staging`.
+
prePatch = "";
+
postPatch = "";
-
postInstall =
-
lib.optionalString (enableShared && !stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isWindows)
-
''
-
# libcxxabi wants to link to libunwind_shared.so (?).
-
ln -s $out/lib/libunwind.so $out/lib/libunwind_shared.so
-
''
-
+ lib.optionalString (enableShared && stdenv.hostPlatform.isWindows) ''
-
ln -s $out/lib/libunwind.dll.a $out/lib/libunwind_shared.dll.a
+
postInstall =
+
lib.optionalString (enableShared && !stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isWindows)
''
-
+ lib.optionalString (doFakeLibgcc && !stdenv.hostPlatform.isWindows) ''
-
ln -s $out/lib/libunwind.so $out/lib/libgcc_s.so
-
ln -s $out/lib/libunwind.so $out/lib/libgcc_s.so.1
+
# libcxxabi wants to link to libunwind_shared.so (?).
+
ln -s $out/lib/libunwind.so $out/lib/libunwind_shared.so
''
-
+ lib.optionalString (doFakeLibgcc && stdenv.hostPlatform.isWindows) ''
-
ln -s $out/lib/libunwind.dll.a $out/lib/libgcc_s.dll.a
-
'';
+
+ lib.optionalString (enableShared && stdenv.hostPlatform.isWindows) ''
+
ln -s $out/lib/libunwind.dll.a $out/lib/libunwind_shared.dll.a
+
''
+
+ lib.optionalString (doFakeLibgcc && !stdenv.hostPlatform.isWindows) ''
+
ln -s $out/lib/libunwind.so $out/lib/libgcc_s.so
+
ln -s $out/lib/libunwind.so $out/lib/libgcc_s.so.1
+
''
+
+ lib.optionalString (doFakeLibgcc && stdenv.hostPlatform.isWindows) ''
+
ln -s $out/lib/libunwind.dll.a $out/lib/libgcc_s.dll.a
+
'';
-
meta = llvm_meta // {
-
# Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst
-
homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library";
-
description = "LLVM's unwinder library";
-
longDescription = ''
-
The unwind library provides a family of _Unwind_* functions implementing
-
the language-neutral stack unwinding portion of the Itanium C++ ABI (Level
-
I). It is a dependency of the C++ ABI library, and sometimes is a
-
dependency of other runtimes.
-
'';
-
};
-
}
-
)
+
meta = llvm_meta // {
+
# Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst
+
homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library";
+
description = "LLVM's unwinder library";
+
longDescription = ''
+
The unwind library provides a family of _Unwind_* functions implementing
+
the language-neutral stack unwinding portion of the Itanium C++ ABI (Level
+
I). It is a dependency of the C++ ABI library, and sometimes is a
+
dependency of other runtimes.
+
'';
+
};
+
})
+19 -38
pkgs/development/compilers/llvm/common/lld/default.nix
···
src =
if monorepoSrc != null then
-
runCommand "lld-src-${version}" { inherit (monorepoSrc) passthru; } (
-
''
-
mkdir -p "$out"
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "14") ''
-
cp -r ${monorepoSrc}/cmake "$out"
-
''
-
+ ''
-
cp -r ${monorepoSrc}/lld "$out"
-
mkdir -p "$out/libunwind"
-
cp -r ${monorepoSrc}/libunwind/include "$out/libunwind"
-
mkdir -p "$out/llvm"
-
''
-
)
+
runCommand "lld-src-${version}" { inherit (monorepoSrc) passthru; } (''
+
mkdir -p "$out"
+
cp -r ${monorepoSrc}/cmake "$out"
+
cp -r ${monorepoSrc}/lld "$out"
+
mkdir -p "$out/libunwind"
+
cp -r ${monorepoSrc}/libunwind/include "$out/libunwind"
+
mkdir -p "$out/llvm"
+
'')
else
src;
···
patches = [
(getVersionFile "lld/gnu-install-dirs.patch")
]
-
++ lib.optional (lib.versions.major release_version == "14") (
-
getVersionFile "lld/fix-root-src-dir.patch"
-
)
-
++ lib.optional (lib.versionAtLeast release_version "16" && lib.versionOlder release_version "18") (
-
getVersionFile "lld/add-table-base.patch"
-
)
++ lib.optional (lib.versions.major release_version == "18") (
# https://github.com/llvm/llvm-project/pull/97122
fetchpatch {
···
}
);
-
nativeBuildInputs = [ cmake ] ++ lib.optional (lib.versionAtLeast release_version "15") ninja;
+
nativeBuildInputs = [
+
cmake
+
ninja
+
];
buildInputs = [
libllvm
libxml2
];
-
cmakeFlags =
-
lib.optionals (lib.versionOlder release_version "14") [
-
(lib.cmakeFeature "LLVM_CONFIG_PATH" "${libllvm.dev}/bin/llvm-config${
-
lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"
-
}")
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "15") [
-
(lib.cmakeFeature "LLD_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/lld")
-
]
-
++ [
-
(lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen")
-
]
-
++ devExtraCmakeFlags;
+
cmakeFlags = [
+
(lib.cmakeFeature "LLD_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/lld")
+
(lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen")
+
]
+
++ devExtraCmakeFlags;
-
postPatch = lib.optionalString (lib.versionOlder release_version "14") ''
-
substituteInPlace MachO/CMakeLists.txt --replace-fail \
-
'(''${LLVM_MAIN_SRC_DIR}/' '(../'
-
'';
+
# TODO: Remove on `staging`.
+
postPatch = "";
# Musl's default stack size is too small for lld to be able to link Firefox.
LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-Wl,-z,stack-size=2097152";
+24 -98
pkgs/development/compilers/llvm/common/lldb/default.nix
···
let
vscodeExt = {
-
name = if lib.versionAtLeast release_version "18" then "lldb-dap" else "lldb-vscode";
-
version = if lib.versionAtLeast release_version "18" then "0.2.0" else "0.1.0";
+
name = "lldb-dap";
+
version = "0.2.0";
};
in
···
runCommand "lldb-src-${version}" { inherit (monorepoSrc) passthru; } (
''
mkdir -p "$out"
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "14") ''
cp -r ${monorepoSrc}/cmake "$out"
-
''
-
+ ''
cp -r ${monorepoSrc}/lldb "$out"
''
+ lib.optionalString (lib.versionAtLeast release_version "19" && enableManpages) ''
···
"dev"
];
-
sourceRoot = lib.optional (lib.versionAtLeast release_version "13") "${finalAttrs.src.name}/lldb";
+
sourceRoot = "${finalAttrs.src.name}/lldb";
-
patches =
-
let
-
resourceDirPatch =
-
(replaceVars (getVersionFile "lldb/resource-dir.patch") {
-
clangLibDir = "${lib.getLib libclang}/lib";
-
}).overrideAttrs
-
(_: _: { name = "resource-dir.patch"; });
-
in
-
lib.optionals (lib.versionOlder release_version "15") [
-
# Fixes for SWIG 4
-
(fetchpatch2 {
-
url = "https://github.com/llvm/llvm-project/commit/81fc5f7909a4ef5a8d4b5da2a10f77f7cb01ba63.patch?full_index=1";
-
stripLen = 1;
-
hash = "sha256-Znw+C0uEw7lGETQLKPBZV/Ymo2UigZS+Hv/j1mUo7p0=";
-
})
-
(fetchpatch2 {
-
url = "https://github.com/llvm/llvm-project/commit/f0a25fe0b746f56295d5c02116ba28d2f965c175.patch?full_index=1";
-
stripLen = 1;
-
hash = "sha256-QzVeZzmc99xIMiO7n//b+RNAvmxghISKQD93U2zOgFI=";
-
})
-
]
-
++ lib.optionals (lib.versionOlder release_version "16") [
-
# Fixes for SWIG 4
-
(fetchpatch2 {
-
url = "https://github.com/llvm/llvm-project/commit/ba35c27ec9aa9807f5b4be2a0c33ca9b045accc7.patch?full_index=1";
-
stripLen = 1;
-
hash = "sha256-LXl+WbpmWZww5xMDrle3BM2Tw56v8k9LO1f1Z1/wDTs=";
-
})
-
(fetchpatch2 {
-
url = "https://github.com/llvm/llvm-project/commit/9ec115978ea2bdfc60800cd3c21264341cdc8b0a.patch?full_index=1";
-
stripLen = 1;
-
hash = "sha256-u0zSejEjfrH3ZoMFm1j+NVv2t5AP9cE5yhsrdTS1dG4=";
-
})
-
-
# FIXME: do we need this after 15?
-
(getVersionFile "lldb/procfs.patch")
-
]
-
++ lib.optional (lib.versionOlder release_version "18") (fetchpatch {
-
name = "libcxx-19-char_traits.patch";
-
url = "https://github.com/llvm/llvm-project/commit/68744ffbdd7daac41da274eef9ac0d191e11c16d.patch";
-
stripLen = 1;
-
hash = "sha256-QCGhsL/mi7610ZNb5SqxjRGjwJeK2rwtsFVGeG3PUGc=";
-
})
-
++ lib.optionals (lib.versionOlder release_version "17") [
-
resourceDirPatch
-
(fetchpatch {
-
name = "add-cstdio.patch";
-
url = "https://github.com/llvm/llvm-project/commit/73e15b5edb4fa4a77e68c299a6e3b21e610d351f.patch";
-
stripLen = 1;
-
hash = "sha256-eFcvxZaAuBsY/bda1h9212QevrXyvCHw8Cr9ngetDr0=";
-
})
-
]
-
++ lib.optional (lib.versionOlder release_version "14") (
-
getVersionFile "lldb/gnu-install-dirs.patch"
-
)
-
++ lib.optional (lib.versionAtLeast release_version "14") ./gnu-install-dirs.patch;
+
patches = [ ./gnu-install-dirs.patch ];
nativeBuildInputs = [
cmake
···
]
++ lib.optionals enableManpages [
python3.pkgs.sphinx
-
]
-
++ lib.optionals (lib.versionOlder release_version "18" && enableManpages) [
-
python3.pkgs.recommonmark
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "18" && enableManpages) [
python3.pkgs.myst-parser
]
-
++ lib.optionals (lib.versionAtLeast release_version "14") [
+
# TODO: Clean up on `staging`.
+
++ [
ninja
];
···
libedit
libxml2
libllvm
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "16") [
# Starting with LLVM 16, the resource dir patch is no longer enough to get
# libclang into the rpath of the lldb executables. By putting it into
# buildInputs cc-wrapper will set up rpath correctly for us.
···
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
(lib.cmakeFeature "LLDB_CODESIGN_IDENTITY" "") # codesigning makes nondeterministic
]
-
++ lib.optionals (lib.versionAtLeast release_version "17") [
+
# TODO: Clean up on `staging`.
+
++ [
(lib.cmakeFeature "CLANG_RESOURCE_DIR" "../../../../${lib.getLib libclang}")
]
-
++ lib.optionals enableManpages (
-
[
-
(lib.cmakeBool "LLVM_ENABLE_SPHINX" true)
-
(lib.cmakeBool "SPHINX_OUTPUT_MAN" true)
-
(lib.cmakeBool "SPHINX_OUTPUT_HTML" false)
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "15") [
-
# docs reference `automodapi` but it's not added to the extensions list when
-
# only building the manpages:
-
# https://github.com/llvm/llvm-project/blob/af6ec9200b09039573d85e349496c4f5b17c3d7f/lldb/docs/conf.py#L54
-
#
-
# so, we just ignore the resulting errors
-
(lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false)
-
]
-
)
+
++ lib.optionals enableManpages [
+
(lib.cmakeBool "LLVM_ENABLE_SPHINX" true)
+
(lib.cmakeBool "SPHINX_OUTPUT_MAN" true)
+
(lib.cmakeBool "SPHINX_OUTPUT_HTML" false)
+
# docs reference `automodapi` but it's not added to the extensions list when
+
# only building the manpages:
+
# https://github.com/llvm/llvm-project/blob/af6ec9200b09039573d85e349496c4f5b17c3d7f/lldb/docs/conf.py#L54
+
#
+
# so, we just ignore the resulting errors
+
(lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false)
+
]
++ lib.optionals finalAttrs.finalPackage.doCheck [
(lib.cmakeFeature "LLDB_TEST_C_COMPILER" "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc")
(lib.cmakeFeature "-DLLDB_TEST_CXX_COMPILER" "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++")
···
++ devExtraCmakeFlags;
doCheck = false;
-
doInstallCheck = lib.versionOlder release_version "15";
+
doInstallCheck = false;
# TODO: cleanup with mass-rebuild
installCheckPhase = ''
···
echo "ERROR: python files not installed where expected!";
return 1;
fi
-
'' # Something lua is built on older versions but this file doesn't exist.
-
+ lib.optionalString (lib.versionAtLeast release_version "14") ''
if [ ! -e "''${!outputLib}/lib/lua/${lua5_3.luaversion}/lldb.so" ] ; then
echo "ERROR: lua files not installed where expected!";
return 1;
···
# vscode:
install -D ../tools/${vscodeExt.name}/package.json $out/share/vscode/extensions/llvm-org.${vscodeExt.name}-${vscodeExt.version}/package.json
mkdir -p $out/share/vscode/extensions/llvm-org.${vscodeExt.name}-${vscodeExt.version}/bin
-
ln -s $out/bin/*${
-
if lib.versionAtLeast release_version "18" then vscodeExt.name else "-vscode"
-
} $out/share/vscode/extensions/llvm-org.${vscodeExt.name}-${vscodeExt.version}/bin
+
ln -s $out/bin/*${vscodeExt.name} $out/share/vscode/extensions/llvm-org.${vscodeExt.name}-${vscodeExt.version}/bin
'';
passthru.vscodeExtName = vscodeExt.name;
···
larger LLVM Project, such as the Clang expression parser and LLVM
disassembler.
'';
-
broken = lib.versionOlder release_version "14";
mainProgram = "lldb";
};
}
// lib.optionalAttrs enableManpages {
pname = "lldb-manpages";
-
buildPhase = lib.optionalString (lib.versionOlder release_version "15") ''
-
make ${if (lib.versionOlder release_version "12") then "docs-man" else "docs-lldb-man"}
-
'';
+
# TODO: Remove on `staging`.
+
buildPhase = "";
-
ninjaFlags = lib.optionals (lib.versionAtLeast release_version "15") [ "docs-lldb-man" ];
+
ninjaFlags = [ "docs-lldb-man" ];
propagatedBuildInputs = [ ];
+162 -395
pkgs/development/compilers/llvm/common/llvm/default.nix
···
# broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245
# broken for the armv7l builder
&& !stdenv.hostPlatform.isAarch,
-
enablePolly ? lib.versionAtLeast release_version "14",
+
enablePolly ? true,
enableTerminfo ? true,
devExtraCmakeFlags ? [ ],
getVersionFile,
···
pname = "llvm";
inherit version;
-
# Used when creating a version-suffixed symlink of libLLVM.dylib
+
# TODO: Remove on `staging`.
shortVersion = lib.concatStringsSep "." (lib.take 1 (lib.splitString "." release_version));
src =
···
''
mkdir -p "$out"
cp -r ${monorepoSrc}/llvm "$out"
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "14") ''
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/third-party "$out"
''
···
];
patches =
-
lib.optional (lib.versionOlder release_version "14")
-
# 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.
-
./llvm-config-link-static.patch
-
++ lib.optionals (lib.versions.major release_version == "12") [
-
# Fix llvm being miscompiled by some gccs. See https://github.com/llvm/llvm-project/issues/49955
-
(getVersionFile "llvm/fix-llvm-issue-49955.patch")
-
-
# On older CPUs (e.g. Hydra/wendy) we'd be getting an error in this test.
-
(fetchpatch {
-
name = "uops-CMOV16rm-noreg.diff";
-
url = "https://github.com/llvm/llvm-project/commit/9e9f991ac033.diff";
-
sha256 = "sha256:12s8vr6ibri8b48h2z38f3afhwam10arfiqfy4yg37bmc054p5hi";
-
stripLen = 1;
-
})
-
]
# Support custom installation dirs
# Originally based off https://reviews.llvm.org/D99484
# Latest state: https://github.com/llvm/llvm-project/pull/125376
-
++ [ (getVersionFile "llvm/gnu-install-dirs.patch") ]
-
++ lib.optionals (lib.versionAtLeast release_version "15") [
+
[ (getVersionFile "llvm/gnu-install-dirs.patch") ]
+
++ [
# Running the tests involves invoking binaries (like `opt`) that depend on
# the LLVM dylibs and reference them by absolute install path (i.e. their
# nix store path).
···
(getVersionFile "llvm/lit-shell-script-runner-set-dyld-library-path.patch")
]
++
-
lib.optional (lib.versions.major release_version == "13")
-
# 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;
-
}
-
)
-
++
-
lib.optional (lib.versionAtLeast release_version "12" && lib.versionOlder release_version "19")
+
lib.optional (lib.versionOlder release_version "19")
# Add missing include headers to build against gcc-15:
# https://github.com/llvm/llvm-project/pull/101761
(
···
stripLen = 1;
}
)
-
++ lib.optionals (lib.versionOlder release_version "16") [
-
# Fix musl build.
-
(fetchpatch {
-
url = "https://github.com/llvm/llvm-project/commit/5cd554303ead0f8891eee3cd6d25cb07f5a7bf67.patch";
-
relative = "llvm";
-
hash = "sha256-XPbvNJ45SzjMGlNUgt/IgEvM2dHQpDOe6woUJY+nUYA=";
-
})
-
# Fix for Python 3.13
-
(getVersionFile "llvm/no-pipes.patch")
-
]
-
++ lib.optionals (lib.versionOlder release_version "14") [
-
# 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;
-
})
-
]
-
++
-
lib.optionals
-
(
-
(lib.versionAtLeast (lib.versions.major release_version) "14")
-
&& (lib.versionOlder (lib.versions.major release_version) "17")
-
)
-
[
-
# fix RuntimeDyld usage on aarch64-linux (e.g. python312Packages.numba tests)
-
# See also: https://github.com/numba/numba/issues/9109
-
(fetchpatch {
-
url = "https://github.com/llvm/llvm-project/commit/2e1b838a889f9793d4bcd5dbfe10db9796b77143.patch";
-
relative = "llvm";
-
hash = "sha256-Ot45P/iwaR4hkcM3xtLwfryQNgHI6pv6ADjv98tgdZA=";
-
})
-
]
-
++
-
lib.optional (lib.versions.major release_version == "17")
-
# Fixes a crash with -fzero-call-used-regs=used-gpr
-
# See also https://github.com/llvm/llvm-project/issues/75168
-
(
-
fetchpatch {
-
name = "fix-fzero-call-used-regs.patch";
-
url = "https://github.com/llvm/llvm-project/commit/f800c1f3b207e7bcdc8b4c7192928d9a078242a0.patch";
-
stripLen = 1;
-
hash = "sha256-e8YKrMy2rGcSJGC6er2V66cOnAnI+u1/yImkvsRsmg8=";
-
}
-
)
++ lib.optionals (lib.versions.major release_version == "18") [
# Reorgs one test so the next patch applies
(fetchpatch {
···
hash = "sha256-fqw5gTSEOGs3kAguR4tINFG7Xja1RAje+q67HJt2nGg=";
})
]
-
++
-
lib.optionals (lib.versionAtLeast release_version "17" && lib.versionOlder release_version "19")
-
[
-
# Fixes test-suite on glibc 2.40 (https://github.com/llvm/llvm-project/pull/100804)
-
(fetchpatch {
-
url = "https://github.com/llvm/llvm-project/commit/1e8df9e85a1ff213e5868bd822877695f27504ad.patch";
-
hash = "sha256-mvBlG2RxpZPFnPI7jvCMz+Fc8JuM15Ye3th1FVZMizE=";
-
stripLen = 1;
-
})
-
]
+
++ lib.optionals (lib.versionOlder release_version "19") [
+
# Fixes test-suite on glibc 2.40 (https://github.com/llvm/llvm-project/pull/100804)
+
(fetchpatch {
+
url = "https://github.com/llvm/llvm-project/commit/1e8df9e85a1ff213e5868bd822877695f27504ad.patch";
+
hash = "sha256-mvBlG2RxpZPFnPI7jvCMz+Fc8JuM15Ye3th1FVZMizE=";
+
stripLen = 1;
+
})
+
]
++ lib.optionals enablePolly [
# Just like the `gnu-install-dirs` patch, but for `polly`.
(getVersionFile "llvm/gnu-install-dirs-polly.patch")
]
-
++
-
lib.optional (lib.versionAtLeast release_version "15")
-
# Just like the `llvm-lit-cfg` patch, but for `polly`.
-
(getVersionFile "llvm/polly-lit-cfg-add-libs-to-dylib-path.patch")
+
++ [
+
# Just like the `llvm-lit-cfg` patch, but for `polly`.
+
(getVersionFile "llvm/polly-lit-cfg-add-libs-to-dylib-path.patch")
+
]
++
lib.optional (lib.versions.major release_version == "20")
# Test failure on riscv64, fixed in llvm 21
···
# this is needed until scripts are updated to not use /usr/bin/uname on FreeBSD native
updateAutotoolsGnuConfigScriptsHook
python
+
ninja
]
-
++ (lib.optional (lib.versionAtLeast release_version "15") ninja)
++ optionals enableManpages [
# Note: we intentionally use `python3Packages` instead of `python3.pkgs`;
# splicing does *not* work with the latter. (TODO: fix)
python3Packages.sphinx
-
]
-
++ optionals (lib.versionOlder version "18" && enableManpages) [
-
python3Packages.recommonmark
-
]
-
++ optionals (lib.versionAtLeast version "18" && enableManpages) [
python3Packages.myst-parser
];
···
]
++ optional enablePFM libpfm; # exegesis
-
propagatedBuildInputs =
-
(lib.optional (
-
lib.versionAtLeast release_version "14" || stdenv.buildPlatform == stdenv.hostPlatform
-
) ncurses)
-
++ [ zlib ];
+
propagatedBuildInputs = [
+
ncurses
+
zlib
+
];
+
+
nativeCheckInputs = [
+
which
+
]
+
++ lib.optional stdenv.hostPlatform.isDarwin sysctl;
postPatch =
optionalString stdenv.hostPlatform.isDarwin (
···
+
# As of LLVM 15, marked as XFAIL on arm64 macOS but lit doesn't seem to pick
# this up: https://github.com/llvm/llvm-project/blob/c344d97a125b18f8fed0a64aace73c49a870e079/llvm/test/MC/ELF/cfi-version.ll#L7
-
(optionalString (lib.versionAtLeast release_version "15") (
-
''
-
rm test/MC/ELF/cfi-version.ll
+
''
+
rm test/MC/ELF/cfi-version.ll
+
''
+
+
+
# This test tries to call `sw_vers` by absolute path (`/usr/bin/sw_vers`)
+
# and thus fails under the sandbox:
+
''
+
substituteInPlace unittests/TargetParser/Host.cpp \
+
--replace-fail '/usr/bin/sw_vers' "${(builtins.toString darwin.DarwinTools) + "/bin/sw_vers"}"
+
''
+
+
+
# This test tries to call the intrinsics `@llvm.roundeven.f32` and
+
# `@llvm.roundeven.f64` which seem to (incorrectly?) lower to `roundevenf`
+
# and `roundeven` on macOS and FreeBSD.
+
#
+
# However these functions are glibc specific so the test fails:
+
# - https://www.gnu.org/software/gnulib/manual/html_node/roundevenf.html
+
# - https://www.gnu.org/software/gnulib/manual/html_node/roundeven.html
+
#
+
# TODO(@rrbutani): this seems to run fine on `aarch64-darwin`, why does it
+
# pass there?
+
''
+
substituteInPlace test/ExecutionEngine/Interpreter/intrinsics.ll \
+
--replace-fail "%roundeven32 = call float @llvm.roundeven.f32(float 0.000000e+00)" "" \
+
--replace-fail "%roundeven64 = call double @llvm.roundeven.f64(double 0.000000e+00)" ""
+
''
+
+
+
# fails when run in sandbox
+
optionalString (!stdenv.hostPlatform.isx86) ''
+
substituteInPlace unittests/Support/VirtualFileSystemTest.cpp \
+
--replace-fail "PhysicalFileSystemWorkingDirFailure" "DISABLED_PhysicalFileSystemWorkingDirFailure"
+
''
+
)
+
+
+
# dup of above patch with different conditions
+
optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86) (
+
# fails when run in sandbox
+
(
+
''
+
substituteInPlace unittests/Support/VirtualFileSystemTest.cpp \
+
--replace-fail "PhysicalFileSystemWorkingDirFailure" "DISABLED_PhysicalFileSystemWorkingDirFailure"
''
+
-
# This test tries to call `sw_vers` by absolute path (`/usr/bin/sw_vers`)
-
# and thus fails under the sandbox:
-
(
-
if lib.versionAtLeast release_version "16" then
-
''
-
substituteInPlace unittests/TargetParser/Host.cpp \
-
--replace-fail '/usr/bin/sw_vers' "${(builtins.toString darwin.DarwinTools) + "/bin/sw_vers"}"
-
''
-
else
-
''
-
substituteInPlace unittests/Support/Host.cpp \
-
--replace-fail '/usr/bin/sw_vers' "${(builtins.toString darwin.DarwinTools) + "/bin/sw_vers"}"
-
''
-
)
-
+
-
# This test tries to call the intrinsics `@llvm.roundeven.f32` and
-
# `@llvm.roundeven.f64` which seem to (incorrectly?) lower to `roundevenf`
-
# and `roundeven` on macOS and FreeBSD.
+
# This test fails on darwin x86_64 because `sw_vers` reports a different
+
# macOS version than what LLVM finds by reading
+
# `/System/Library/CoreServices/SystemVersion.plist` (which is passed into
+
# the sandbox on macOS).
+
#
+
# The `sw_vers` provided by nixpkgs reports the macOS version associated
+
# with the `CoreFoundation` framework with which it was built. Because
+
# nixpkgs pins the SDK for `aarch64-darwin` and `x86_64-darwin` what
+
# `sw_vers` reports is not guaranteed to match the macOS version of the host
+
# that's building this derivation.
+
#
+
# Astute readers will note that we only _patch_ this test on aarch64-darwin
+
# (to use the nixpkgs provided `sw_vers`) instead of disabling it outright.
+
# So why does this test pass on aarch64?
+
#
+
# Well, it seems that `sw_vers` on aarch64 actually links against the _host_
+
# CoreFoundation framework instead of the nixpkgs provided one.
#
-
# However these functions are glibc specific so the test fails:
-
# - https://www.gnu.org/software/gnulib/manual/html_node/roundevenf.html
-
# - https://www.gnu.org/software/gnulib/manual/html_node/roundeven.html
+
# Not entirely sure what the right fix is here. I'm assuming aarch64
+
# `sw_vers` doesn't intentionally link against the host `CoreFoundation`
+
# (still digging into how this ends up happening, will follow up) but that
+
# aside I think the more pertinent question is: should we be patching LLVM's
+
# macOS version detection logic to use `sw_vers` instead of reading host
+
# paths? This *is* a way in which details about builder machines can creep
+
# into the artifacts that are produced, affecting reproducibility, but it's
+
# not clear to me when/where/for what this even gets used in LLVM.
#
-
# TODO(@rrbutani): this seems to run fine on `aarch64-darwin`, why does it
-
# pass there?
-
optionalString (lib.versionAtLeast release_version "16") ''
-
substituteInPlace test/ExecutionEngine/Interpreter/intrinsics.ll \
-
--replace-fail "%roundeven32 = call float @llvm.roundeven.f32(float 0.000000e+00)" "" \
-
--replace-fail "%roundeven64 = call double @llvm.roundeven.f64(double 0.000000e+00)" ""
+
# TODO(@rrbutani): fix/follow-up
+
''
+
substituteInPlace unittests/TargetParser/Host.cpp \
+
--replace-fail "getMacOSHostVersion" "DISABLED_getMacOSHostVersion"
''
+
-
# fails when run in sandbox
-
optionalString (!stdenv.hostPlatform.isx86 && lib.versionAtLeast release_version "18") ''
-
substituteInPlace unittests/Support/VirtualFileSystemTest.cpp \
-
--replace-fail "PhysicalFileSystemWorkingDirFailure" "DISABLED_PhysicalFileSystemWorkingDirFailure"
+
# This test fails with a `dysmutil` crash; have not yet dug into what's
+
# going on here (TODO(@rrbutani)).
+
lib.optionalString (lib.versionOlder release_version "19") ''
+
rm test/tools/dsymutil/ARM/obfuscated.test
''
-
))
-
)
-
+
-
# dup of above patch with different conditions
-
optionalString
-
(
-
stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86 && lib.versionAtLeast release_version "15"
)
-
(
-
optionalString (lib.versionOlder release_version "16") ''
-
substituteInPlace test/ExecutionEngine/Interpreter/intrinsics.ll \
-
--replace-fail "%roundeven32 = call float @llvm.roundeven.f32(float 0.000000e+00)" "" \
-
--replace-fail "%roundeven64 = call double @llvm.roundeven.f64(double 0.000000e+00)" ""
-
-
''
-
+
-
# fails when run in sandbox
-
(
-
(optionalString (lib.versionAtLeast release_version "18") ''
-
substituteInPlace unittests/Support/VirtualFileSystemTest.cpp \
-
--replace-fail "PhysicalFileSystemWorkingDirFailure" "DISABLED_PhysicalFileSystemWorkingDirFailure"
-
'')
-
+
-
# This test fails on darwin x86_64 because `sw_vers` reports a different
-
# macOS version than what LLVM finds by reading
-
# `/System/Library/CoreServices/SystemVersion.plist` (which is passed into
-
# the sandbox on macOS).
-
#
-
# The `sw_vers` provided by nixpkgs reports the macOS version associated
-
# with the `CoreFoundation` framework with which it was built. Because
-
# nixpkgs pins the SDK for `aarch64-darwin` and `x86_64-darwin` what
-
# `sw_vers` reports is not guaranteed to match the macOS version of the host
-
# that's building this derivation.
-
#
-
# Astute readers will note that we only _patch_ this test on aarch64-darwin
-
# (to use the nixpkgs provided `sw_vers`) instead of disabling it outright.
-
# So why does this test pass on aarch64?
-
#
-
# Well, it seems that `sw_vers` on aarch64 actually links against the _host_
-
# CoreFoundation framework instead of the nixpkgs provided one.
-
#
-
# Not entirely sure what the right fix is here. I'm assuming aarch64
-
# `sw_vers` doesn't intentionally link against the host `CoreFoundation`
-
# (still digging into how this ends up happening, will follow up) but that
-
# aside I think the more pertinent question is: should we be patching LLVM's
-
# macOS version detection logic to use `sw_vers` instead of reading host
-
# paths? This *is* a way in which details about builder machines can creep
-
# into the artifacts that are produced, affecting reproducibility, but it's
-
# not clear to me when/where/for what this even gets used in LLVM.
-
#
-
# TODO(@rrbutani): fix/follow-up
-
(
-
if lib.versionAtLeast release_version "16" then
-
''
-
substituteInPlace unittests/TargetParser/Host.cpp \
-
--replace-fail "getMacOSHostVersion" "DISABLED_getMacOSHostVersion"
-
''
-
else
-
''
-
substituteInPlace unittests/Support/Host.cpp \
-
--replace-fail "getMacOSHostVersion" "DISABLED_getMacOSHostVersion"
-
''
-
)
-
+
-
# This test fails with a `dysmutil` crash; have not yet dug into what's
-
# going on here (TODO(@rrbutani)).
-
lib.optionalString (lib.versionOlder release_version "19") ''
-
rm test/tools/dsymutil/ARM/obfuscated.test
-
''
-
)
-
)
+
)
+
# FileSystem permissions tests fail with various special bits
''
···
substituteInPlace unittests/IR/CMakeLists.txt \
--replace-fail "PassBuilderCallbacksTest.cpp" ""
rm unittests/IR/PassBuilderCallbacksTest.cpp
+
rm test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test
''
-
+ lib.optionalString (lib.versionAtLeast release_version "13") ''
-
rm test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test
-
''
-
+ lib.optionalString (lib.versionOlder release_version "13") ''
-
# TODO: Fix failing tests:
-
rm test/DebugInfo/X86/vla-multi.ll
-
''
+
# Fails in the presence of anti-virus software or other intrusion-detection software that
# modifies the atime when run. See #284056.
-
lib.optionalString (lib.versionAtLeast release_version "16") (
-
''
-
rm test/tools/llvm-objcopy/ELF/strip-preserve-atime.test
-
''
-
+ lib.optionalString (lib.versionOlder release_version "17") ''
-
-
''
-
)
-
+
-
# timing-based tests are trouble
-
lib.optionalString
-
(lib.versionAtLeast release_version "15" && lib.versionOlder release_version "17")
-
''
-
rm utils/lit/tests/googletest-timeout.py
-
''
+
''
+
rm test/tools/llvm-objcopy/ELF/strip-preserve-atime.test
+
''
+
# valgrind unhappy with musl or glibc, but fails w/musl only
optionalString stdenv.hostPlatform.isMusl ''
···
''
+ ''
patchShebangs test/BugPoint/compile-custom.ll.py
-
''
-
+
-
# Tweak tests to ignore namespace part of type to support
-
# gcc-12: https://gcc.gnu.org/PR103598.
-
# The change below mangles strings like:
-
# CHECK-NEXT: Starting llvm::Function pass manager run.
-
# to:
-
# CHECK-NEXT: Starting {{.*}}Function pass manager run.
-
(lib.optionalString (lib.versionOlder release_version "13") (
-
''
-
for f in \
-
test/Other/new-pass-manager.ll \
-
test/Other/new-pm-O0-defaults.ll \
-
test/Other/new-pm-defaults.ll \
-
test/Other/new-pm-lto-defaults.ll \
-
test/Other/new-pm-thinlto-defaults.ll \
-
test/Other/pass-pipeline-parsing.ll \
-
test/Transforms/Inline/cgscc-incremental-invalidate.ll \
-
test/Transforms/Inline/clear-analyses.ll \
-
test/Transforms/LoopUnroll/unroll-loop-invalidation.ll \
-
test/Transforms/SCCP/ipsccp-preserve-analysis.ll \
-
test/Transforms/SCCP/preserve-analysis.ll \
-
test/Transforms/SROA/dead-inst.ll \
-
test/tools/gold/X86/new-pm.ll \
-
; do
-
echo "PATCH: $f"
-
substituteInPlace $f \
-
--replace-quiet 'Starting llvm::' 'Starting {{.*}}' \
-
--replace-quiet 'Finished llvm::' 'Finished {{.*}}'
-
done
-
''
-
+
-
# gcc-13 fix
-
''
-
sed -i '/#include <string>/i#include <cstdint>' \
-
include/llvm/DebugInfo/Symbolize/DIPrinter.h
-
''
-
));
+
'';
# Workaround for configure flags that need to have spaces
preConfigure = ''
···
)
'';
+
# Defensive check: some paths (that we make symlinks to) depend on the release
+
# version, for example:
+
# - https://github.com/llvm/llvm-project/blob/406bde9a15136254f2b10d9ef3a42033b3cb1b16/clang/lib/Headers/CMakeLists.txt#L185
+
#
+
# So we want to sure that the version in the source matches the release
+
# version we were given.
+
#
+
# We do this check here, in the LLVM build, because it happens early.
+
postConfigure =
+
let
+
v = lib.versions;
+
major = v.major release_version;
+
minor = v.minor release_version;
+
patch = v.patch release_version;
+
in
+
''
+
# $1: part, $2: expected
+
check_version() {
+
part="''${1^^}"
+
part="$(cat include/llvm/Config/llvm-config.h | grep "#define LLVM_VERSION_''${part} " | cut -d' ' -f3)"
+
+
if [[ "$part" != "$2" ]]; then
+
echo >&2 \
+
"mismatch in the $1 version! we have version ${release_version}" \
+
"and expected the $1 version to be '$2'; the source has '$part' instead"
+
exit 3
+
fi
+
}
+
+
check_version major ${major}
+
check_version minor ${minor}
+
check_version patch ${patch}
+
'';
+
# E.g. Mesa uses the build-id as a cache key (see #93946):
LDFLAGS = optionalString (
enableSharedLibraries && !stdenv.hostPlatform.isDarwin
···
#
# Some flags don't need to be repassed because LLVM already does so (like
# CMAKE_BUILD_TYPE), others are irrelevant to the result.
-
flagsForLlvmConfig =
-
(
-
if lib.versionOlder release_version "15" then
-
[
-
(lib.cmakeFeature "LLVM_INSTALL_CMAKE_DIR" "${placeholder "dev"}/lib/cmake/llvm/")
-
]
-
else
-
[
-
(lib.cmakeFeature "LLVM_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/llvm")
-
]
-
)
-
++ [
-
(lib.cmakeBool "LLVM_ENABLE_RTTI" true)
-
(lib.cmakeBool "LLVM_LINK_LLVM_DYLIB" enableSharedLibraries)
-
(lib.cmakeFeature "LLVM_TABLEGEN" "${buildLlvmTools.tblgen}/bin/llvm-tblgen")
-
];
+
flagsForLlvmConfig = [
+
(lib.cmakeFeature "LLVM_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/llvm")
+
(lib.cmakeBool "LLVM_ENABLE_RTTI" true)
+
(lib.cmakeBool "LLVM_LINK_LLVM_DYLIB" enableSharedLibraries)
+
(lib.cmakeFeature "LLVM_TABLEGEN" "${buildLlvmTools.tblgen}/bin/llvm-tblgen")
+
];
in
flagsForLlvmConfig
++ [
···
moveToOutput "bin/llvm-config*" "$dev"
substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${lib.toLower finalAttrs.finalPackage.cmakeBuildType}.cmake" \
--replace-fail "$out/bin/llvm-config" "$dev/bin/llvm-config"
+
substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \
+
--replace-fail 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "'"$lib"'")'
''
-
+ (
-
if lib.versionOlder release_version "15" then
-
''
-
substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \
-
--replace-fail 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")'
-
''
-
else
-
''
-
substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \
-
--replace-fail 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "'"$lib"'")'
-
''
-
)
+ optionalString (stdenv.hostPlatform.isDarwin && enableSharedLibraries) ''
-
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${
-
if lib.versionOlder release_version "18" then "$shortVersion" else release_version
-
}.dylib
+
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
''
+ optionalString (stdenv.buildPlatform != stdenv.hostPlatform) (
if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
···
doCheck =
!isDarwinBootstrap
&& !stdenv.hostPlatform.isAarch32
-
&& (if lib.versionOlder release_version "15" then stdenv.hostPlatform.isLinux else true)
&& (
!stdenv.hostPlatform.isx86_32 # TODO: why
)
···
'';
};
}
-
// lib.optionalAttrs enableManpages (
-
{
-
pname = "llvm-manpages";
+
// lib.optionalAttrs enableManpages {
+
pname = "llvm-manpages";
-
propagatedBuildInputs = [ ];
+
propagatedBuildInputs = [ ];
-
postPatch = null;
-
postInstall = null;
+
ninjaFlags = [ "docs-llvm-man" ];
+
installTargets = [ "install-docs-llvm-man" ];
-
outputs = [ "out" ];
+
doCheck = false;
-
doCheck = false;
+
postPatch = null;
+
postInstall = null;
-
meta = llvm_meta // {
-
description = "man pages for LLVM ${version}";
-
};
-
}
-
// (
-
if lib.versionOlder release_version "15" then
-
{
-
buildPhase = ''
-
make docs-llvm-man
-
'';
+
outputs = [ "out" ];
-
installPhase = ''
-
make -C docs install
-
'';
-
}
-
else
-
{
-
ninjaFlags = [ "docs-llvm-man" ];
-
installTargets = [ "install-docs-llvm-man" ];
-
-
postPatch = null;
-
postInstall = null;
-
}
-
)
-
)
-
// lib.optionalAttrs (lib.versionAtLeast release_version "13") {
-
nativeCheckInputs = [
-
which
-
]
-
++ lib.optional (stdenv.hostPlatform.isDarwin && lib.versionAtLeast release_version "15") sysctl;
-
}
-
// lib.optionalAttrs (lib.versionOlder release_version "15") {
-
# hacky fix: created binaries need to be run before installation
-
preBuild = ''
-
mkdir -p $out/
-
ln -sv $PWD/lib $out
-
'';
-
-
postBuild = ''
-
rm -fR $out
-
'';
-
-
preCheck = ''
-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
-
'';
-
}
-
// lib.optionalAttrs (lib.versionAtLeast release_version "15") {
-
# Defensive check: some paths (that we make symlinks to) depend on the release
-
# version, for example:
-
# - https://github.com/llvm/llvm-project/blob/406bde9a15136254f2b10d9ef3a42033b3cb1b16/clang/lib/Headers/CMakeLists.txt#L185
-
#
-
# So we want to sure that the version in the source matches the release
-
# version we were given.
-
#
-
# We do this check here, in the LLVM build, because it happens early.
-
postConfigure =
-
let
-
v = lib.versions;
-
major = v.major release_version;
-
minor = v.minor release_version;
-
patch = v.patch release_version;
-
in
-
''
-
# $1: part, $2: expected
-
check_version() {
-
part="''${1^^}"
-
part="$(cat include/llvm/Config/llvm-config.h | grep "#define LLVM_VERSION_''${part} " | cut -d' ' -f3)"
-
-
if [[ "$part" != "$2" ]]; then
-
echo >&2 \
-
"mismatch in the $1 version! we have version ${release_version}" \
-
"and expected the $1 version to be '$2'; the source has '$part' instead"
-
exit 3
-
fi
-
}
-
-
check_version major ${major}
-
check_version minor ${minor}
-
check_version patch ${patch}
-
'';
+
meta = llvm_meta // {
+
description = "man pages for LLVM ${version}";
+
};
}
)
-12
pkgs/development/compilers/llvm/common/llvm/llvm-config-link-static.patch
···
-
diff --git llvm/tools/llvm-config/CMakeLists.txt llvm/tools/llvm-config/CMakeLists.txt
-
index 16ba54c0cf2f..20b017195e84 100644
-
--- llvm/tools/llvm-config/CMakeLists.txt
-
+++ llvm/tools/llvm-config/CMakeLists.txt
-
@@ -6,6 +6,7 @@ set(BUILDVARIABLES_OBJPATH ${CMAKE_CURRENT_BINARY_DIR}/BuildVariables.inc)
-
# Add the llvm-config tool.
-
add_llvm_tool(llvm-config
-
llvm-config.cpp
-
+ DISABLE_LLVM_LINK_LLVM_DYLIB
-
)
-
-
# Compute the substitution values for various items.
+7 -13
pkgs/development/compilers/llvm/common/mlir/default.nix
···
&& (!stdenv.hostPlatform.isMusl);
# Blank llvm dir just so relative path works
-
src = runCommand "${finalAttrs.pname}-src-${version}" { inherit (monorepoSrc) passthru; } (
-
''
-
mkdir -p "$out"
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "14") ''
-
cp -r ${monorepoSrc}/cmake "$out"
-
''
-
+ ''
-
cp -r ${monorepoSrc}/mlir "$out"
-
cp -r ${monorepoSrc}/third-party "$out/third-party"
+
src = runCommand "${finalAttrs.pname}-src-${version}" { inherit (monorepoSrc) passthru; } (''
+
mkdir -p "$out"
+
cp -r ${monorepoSrc}/cmake "$out"
+
cp -r ${monorepoSrc}/mlir "$out"
+
cp -r ${monorepoSrc}/third-party "$out/third-party"
-
mkdir -p "$out/llvm"
-
''
-
);
+
mkdir -p "$out/llvm"
+
'');
sourceRoot = "${finalAttrs.src.name}/mlir";
+74 -101
pkgs/development/compilers/llvm/common/openmp/default.nix
···
assert lib.assertMsg (ompdGdbSupport -> ompdSupport) "OMPD GDB support requires OMPD support!";
-
stdenv.mkDerivation (
-
finalAttrs:
-
{
-
pname = "openmp";
-
inherit version;
+
stdenv.mkDerivation (finalAttrs: {
+
pname = "openmp";
+
inherit version;
-
src =
-
if monorepoSrc != null then
-
runCommand "openmp-src-${version}" { inherit (monorepoSrc) passthru; } (
-
''
-
mkdir -p "$out"
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "14") ''
-
cp -r ${monorepoSrc}/cmake "$out"
-
''
-
+ ''
-
cp -r ${monorepoSrc}/openmp "$out"
-
''
-
)
-
else
-
src;
+
src =
+
if monorepoSrc != null then
+
runCommand "openmp-src-${version}" { inherit (monorepoSrc) passthru; } (''
+
mkdir -p "$out"
+
cp -r ${monorepoSrc}/cmake "$out"
+
cp -r ${monorepoSrc}/openmp "$out"
+
'')
+
else
+
src;
-
sourceRoot = "${finalAttrs.src.name}/openmp";
+
sourceRoot = "${finalAttrs.src.name}/openmp";
-
outputs = [ "out" ] ++ lib.optionals (lib.versionAtLeast release_version "14") [ "dev" ];
+
outputs = [
+
"out"
+
"dev"
+
];
-
patchFlags = if lib.versionOlder release_version "14" then [ "-p2" ] else null;
+
# TODO: Remove on `staging`.
+
patchFlags = null;
-
patches =
-
lib.optional (lib.versionAtLeast release_version "15" && lib.versionOlder release_version "19") (
-
getVersionFile "openmp/fix-find-tool.patch"
-
)
-
++ lib.optional (lib.versionAtLeast release_version "14" && lib.versionOlder release_version "18") (
-
getVersionFile "openmp/gnu-install-dirs.patch"
-
)
-
++ lib.optional (lib.versionAtLeast release_version "14") (
-
getVersionFile "openmp/run-lit-directly.patch"
-
)
-
++
-
lib.optional (lib.versionOlder release_version "14")
-
# Fix cross.
-
(
-
fetchpatch {
-
url = "https://github.com/llvm/llvm-project/commit/5e2358c781b85a18d1463fd924d2741d4ae5e42e.patch";
-
hash = "sha256-UxIlAifXnexF/MaraPW0Ut6q+sf3e7y1fMdEv1q103A=";
-
}
-
);
+
patches =
+
lib.optional (lib.versionOlder release_version "19") (getVersionFile "openmp/fix-find-tool.patch")
+
++ [
+
(getVersionFile "openmp/run-lit-directly.patch")
+
];
+
+
nativeBuildInputs = [
+
cmake
+
python3.pythonOnBuildForHost
+
perl
+
ninja
+
pkg-config
+
lit
+
];
+
+
buildInputs = [
+
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
+
]
+
++ lib.optionals (ompdSupport && ompdGdbSupport) [
+
python3
+
];
+
+
cmakeFlags = [
+
(lib.cmakeBool "LIBOMP_ENABLE_SHARED" (
+
!stdenv.hostPlatform.isStatic && stdenv.hostPlatform.hasSharedLibraries
+
))
+
(lib.cmakeBool "LIBOMP_OMPD_SUPPORT" ompdSupport)
+
(lib.cmakeBool "LIBOMP_OMPD_GDB_SUPPORT" ompdGdbSupport)
+
(lib.cmakeFeature "CLANG_TOOL" "${clang-unwrapped}/bin/clang")
+
(lib.cmakeFeature "OPT_TOOL" "${llvm}/bin/opt")
+
(lib.cmakeFeature "LINK_TOOL" "${llvm}/bin/llvm-link")
+
]
+
++ devExtraCmakeFlags;
-
nativeBuildInputs = [
-
cmake
-
python3.pythonOnBuildForHost
-
perl
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "15") [
-
ninja
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "14") [
-
pkg-config
-
lit
-
];
+
doCheck = false;
-
buildInputs = [
-
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
-
]
-
++ lib.optionals (ompdSupport && ompdGdbSupport) [
-
python3
-
];
+
checkTarget = "check-openmp";
-
cmakeFlags = [
-
(lib.cmakeBool "LIBOMP_ENABLE_SHARED" (
-
!stdenv.hostPlatform.isStatic && stdenv.hostPlatform.hasSharedLibraries
-
))
-
(lib.cmakeBool "LIBOMP_OMPD_SUPPORT" ompdSupport)
-
(lib.cmakeBool "LIBOMP_OMPD_GDB_SUPPORT" ompdGdbSupport)
-
]
-
++ lib.optionals (lib.versions.major release_version == "13") [
-
(lib.cmakeBool "LIBOMPTARGET_BUILD_AMDGCN_BCLIB" false) # Building the AMDGCN device RTL fails
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "14") [
-
(lib.cmakeFeature "CLANG_TOOL" "${clang-unwrapped}/bin/clang")
-
(lib.cmakeFeature "OPT_TOOL" "${llvm}/bin/opt")
-
(lib.cmakeFeature "LINK_TOOL" "${llvm}/bin/llvm-link")
-
]
-
++ devExtraCmakeFlags;
+
preCheck = ''
+
patchShebangs ../tools/archer/tests/deflake.bash
+
'';
-
meta = llvm_meta // {
-
homepage = "https://openmp.llvm.org/";
-
description = "Support for the OpenMP language";
-
longDescription = ''
-
The OpenMP subproject of LLVM contains the components required to build an
-
executable OpenMP program that are outside the compiler itself.
-
Contains the code for the runtime library against which code compiled by
-
"clang -fopenmp" must be linked before it can run and the library that
-
supports offload to target devices.
-
'';
-
# "All of the code is dual licensed under the MIT license and the UIUC
-
# License (a BSD-like license)":
-
license = with lib.licenses; [
-
mit
-
ncsa
-
];
-
};
-
}
-
// (lib.optionalAttrs (lib.versionAtLeast release_version "14") {
-
doCheck = false;
-
checkTarget = "check-openmp";
-
preCheck = ''
-
patchShebangs ../tools/archer/tests/deflake.bash
+
meta = llvm_meta // {
+
homepage = "https://openmp.llvm.org/";
+
description = "Support for the OpenMP language";
+
longDescription = ''
+
The OpenMP subproject of LLVM contains the components required to build an
+
executable OpenMP program that are outside the compiler itself.
+
Contains the code for the runtime library against which code compiled by
+
"clang -fopenmp" must be linked before it can run and the library that
+
supports offload to target devices.
'';
-
})
-
)
+
# "All of the code is dual licensed under the MIT license and the UIUC
+
# License (a BSD-like license)":
+
license = with lib.licenses; [
+
mit
+
ncsa
+
];
+
};
+
})
+8 -151
pkgs/development/compilers/llvm/common/patches.nix
···
{
"clang/gnu-install-dirs.patch" = [
{
-
before = "14";
-
path = ../12;
-
}
-
{
after = "19";
path = ../19;
}
];
"clang/purity.patch" = [
{
-
after = "18";
path = ../18;
}
-
{
-
before = "17";
-
after = "15";
-
path = ../15;
-
}
-
{
-
before = "16";
-
path = ../12;
-
}
-
];
-
"clang/aarch64-tblgen.patch" = [
-
{
-
after = "17";
-
before = "18";
-
path = ../17;
-
}
-
];
-
"lld/add-table-base.patch" = [
-
{
-
after = "16";
-
path = ../16;
-
}
];
"lld/gnu-install-dirs.patch" = [
{
-
after = "18";
path = ../18;
}
-
{
-
before = "14";
-
path = ../12;
-
}
];
"llvm/gnu-install-dirs.patch" = [
{
···
path = ../20;
}
{
-
after = "18";
before = "20";
path = ../18;
}
···
}
{
before = "20";
-
after = "18";
path = ../18;
}
-
{
-
before = "18";
-
after = "14";
-
path = ../14;
-
}
];
"llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch" = [
{
-
before = "17";
-
after = "15";
-
path = ../15;
-
}
-
{
-
after = "17";
-
path = ../17;
+
path = ../18;
}
];
"llvm/lit-shell-script-runner-set-dyld-library-path.patch" = [
{
-
after = "18";
path = ../18;
}
-
{
-
after = "16";
-
before = "18";
-
path = ../16;
-
}
];
"llvm/polly-lit-cfg-add-libs-to-dylib-path.patch" = [
{
-
after = "15";
-
path = ../15;
-
}
-
];
-
"libunwind/gnu-install-dirs.patch" = [
-
{
-
before = "17";
-
after = "15";
-
path = ../15;
+
path = ../18;
}
];
"compiler-rt/X86-support-extension.patch" = [
{
-
after = "15";
-
path = ../15;
-
}
-
{
-
before = "15";
-
path = ../12;
+
path = ../18;
}
];
"compiler-rt/armv6-scudo-libatomic.patch" = [
···
path = ../19;
}
{
-
after = "15";
before = "19";
-
path = ../15;
-
}
-
{
-
before = "15";
-
path = ../14;
-
}
-
];
-
"compiler-rt/armv7l.patch" = [
-
{
-
before = "15";
-
after = "13";
-
path = ../13;
-
}
-
];
-
"compiler-rt/gnu-install-dirs.patch" = [
-
{
-
before = "14";
-
path = ../12;
-
}
-
{
-
after = "13";
-
before = "15";
-
path = ../14;
-
}
-
{
-
after = "15";
-
before = "17";
-
path = ../15;
-
}
-
{
-
after = "16";
-
path = ../17;
-
}
-
];
-
"compiler-rt/darwin-targetconditionals.patch" = [
-
{
-
after = "13";
-
path = ../13;
-
}
-
];
-
"compiler-rt/codesign.patch" = [
-
{
-
after = "13";
-
path = ../13;
+
path = ../18;
}
];
"compiler-rt/normalize-var.patch" = [
{
-
after = "16";
-
path = ../16;
-
}
-
{
-
before = "16";
-
path = ../12;
-
}
-
];
-
"lldb/procfs.patch" = [
-
{
-
after = "15";
-
path = ../15;
-
}
-
{
-
before = "15";
-
path = ../12;
-
}
-
];
-
"lldb/resource-dir.patch" = [
-
{
-
before = "16";
-
path = ../12;
-
}
-
];
-
"llvm/no-pipes.patch" = [
-
{
-
before = "16";
-
path = ../12;
+
path = ../18;
}
];
"openmp/fix-find-tool.patch" = [
{
-
after = "17";
before = "19";
-
path = ../17;
+
path = ../18;
}
];
"openmp/run-lit-directly.patch" = [
{
-
after = "16";
-
path = ../16;
-
}
-
{
-
after = "14";
-
before = "16";
-
path = ../14;
+
path = ../18;
}
];
"libclc/use-default-paths.patch" = [
···
];
"libclc/gnu-install-dirs.patch" = [
{
-
after = "16";
before = "21";
-
path = ../16;
+
path = ../18;
}
{
after = "21";
+18 -34
pkgs/development/compilers/llvm/common/tblgen.nix
···
src' =
if monorepoSrc != null then
-
runCommand "${pname}-src-${version}" { } (
-
''
-
mkdir -p "$out"
-
''
-
+ lib.optionalString (lib.versionAtLeast release_version "14") ''
-
cp -r ${monorepoSrc}/cmake "$out"
-
cp -r ${monorepoSrc}/third-party "$out"
-
''
-
+ ''
-
cp -r ${monorepoSrc}/llvm "$out"
-
cp -r ${monorepoSrc}/clang "$out"
-
cp -r ${monorepoSrc}/clang-tools-extra "$out"
-
cp -r ${monorepoSrc}/mlir "$out"
-
''
-
)
+
runCommand "${pname}-src-${version}" { } (''
+
mkdir -p "$out"
+
cp -r ${monorepoSrc}/cmake "$out"
+
cp -r ${monorepoSrc}/third-party "$out"
+
cp -r ${monorepoSrc}/llvm "$out"
+
cp -r ${monorepoSrc}/clang "$out"
+
cp -r ${monorepoSrc}/clang-tools-extra "$out"
+
cp -r ${monorepoSrc}/mlir "$out"
+
'')
else
src;
···
targets = [
"clang-tblgen"
"llvm-tblgen"
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "15") [
"clang-tidy-confusable-chars-gen"
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "16") [
"mlir-tblgen"
]
-
++
-
lib.optionals ((lib.versionAtLeast release_version "15") && (lib.versionOlder release_version "20"))
-
[
-
"clang-pseudo-gen" # Removed in LLVM 20 @ ed8f78827895050442f544edef2933a60d4a7935.
-
];
+
++ lib.optionals (lib.versionOlder release_version "20") [
+
"clang-pseudo-gen" # Removed in LLVM 20 @ ed8f78827895050442f544edef2933a60d4a7935.
+
];
self = stdenv.mkDerivation (finalAttrs: {
inherit pname version patches;
···
cmakeFlags = [
# Projects with tablegen-like tools.
"-DLLVM_ENABLE_PROJECTS=${
-
lib.concatStringsSep ";" (
-
[
-
"llvm"
-
"clang"
-
"clang-tools-extra"
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "16") [
-
"mlir"
-
]
-
)
+
lib.concatStringsSep ";" [
+
"llvm"
+
"clang"
+
"clang-tools-extra"
+
"mlir"
+
]
}"
]
++ devExtraCmakeFlags;
-6
pkgs/development/compilers/llvm/default.nix
···
}@packageSetArgs:
let
versions = {
-
"12.0.1".officialRelease.sha256 = "08s5w2db9imb2yaqsvxs6pg21csi1cf6wa35rf8x6q07mam7j8qv";
-
"13.0.1".officialRelease.sha256 = "06dv6h5dmvzdxbif2s8njki6h32796v368dyb5945x8gjj72xh7k";
-
"14.0.6".officialRelease.sha256 = "sha256-vffu4HilvYwtzwgq+NlS26m65DGbp6OSSne2aje1yJE=";
-
"15.0.7".officialRelease.sha256 = "sha256-wjuZQyXQ/jsmvy6y1aksCcEDXGBjuhpgngF3XQJ/T4s=";
-
"16.0.6".officialRelease.sha256 = "sha256-fspqSReX+VD+Nl/Cfq+tDcdPtnQPV1IRopNDfd5VtUs=";
-
"17.0.6".officialRelease.sha256 = "sha256-8MEDLLhocshmxoEBRSKlJ/GzJ8nfuzQ8qn0X/vLA+ag=";
"18.1.8".officialRelease.sha256 = "sha256-iiZKMRo/WxJaBXct9GdAcAT3cz9d9pnAcO1mmR6oPNE=";
"19.1.7".officialRelease.sha256 = "sha256-cZAB5vZjeTsXt9QHbP5xluWNQnAHByHtHnAhVDV0E6I=";
"20.1.8".officialRelease.sha256 = "sha256-ysyB/EYxi2qE9fD5x/F2zI4vjn8UDoo1Z9ukiIrjFGw=";
+5 -31
pkgs/development/compilers/llvm/update.sh
···
readonly ATTRSET="llvmPackages_$VERSION_MAJOR"
-
if [ "$VERSION_MAJOR" -ge "14" ]; then
-
readonly SOURCES=(
-
"llvm.monorepoSrc"
-
)
-
elif [ "$VERSION_MAJOR" -eq "13" ]; then
-
readonly SOURCES=(
-
"llvm.src"
-
)
-
else
-
readonly SOURCES=(
-
"clang-unwrapped.src"
-
"compiler-rt.src"
-
"clang-unwrapped.clang-tools-extra_src"
-
"libcxx.src"
-
"libcxxabi.src"
-
"libunwind.src"
-
"lld.src"
-
"lldb.src"
-
"llvm.src"
-
"llvm.polly_src"
-
"openmp.src"
-
)
-
fi
-
-
for SOURCE in "${SOURCES[@]}"; do
-
echo "Updating the hash of $SOURCE:"
-
declare ATTR="$ATTRSET.$SOURCE"
-
declare OLD_HASH="$(nix --extra-experimental-features nix-command eval -f . $ATTR.outputHash)"
-
declare NEW_HASH="\"$(nix-prefetch-url -A $ATTR)\""
-
find "$DIR" -type f -exec sed -i "s/$OLD_HASH/$NEW_HASH/" {} +
-
done
+
echo "Updating the hash of llvm.monorepoSrc:"
+
declare ATTR="$ATTRSET.llvm.monorepoSrc"
+
declare OLD_HASH="$(nix --extra-experimental-features nix-command eval -f . $ATTR.outputHash)"
+
declare NEW_HASH="\"$(nix-prefetch-url -A $ATTR)\""
+
find "$DIR" -type f -exec sed -i "s/$OLD_HASH/$NEW_HASH/" {} +
echo OK
+22 -3
pkgs/development/compilers/mrustc/bootstrap.nix
···
fetchurl,
mrustc,
mrustc-minicargo,
-
llvm_12,
+
#llvm_12,
libffi,
cmake,
perl,
···
];
buildInputs = [
# for rustc
-
llvm_12
+
#llvm_12
libffi
zlib
libxml2
···
# Use shared mrustc/minicargo/llvm instead of rebuilding them
"MRUSTC=${mrustc}/bin/mrustc"
#"MINICARGO=${mrustc-minicargo}/bin/minicargo" # FIXME: we need to rebuild minicargo locally so --manifest-overrides is applied
-
"LLVM_CONFIG=${llvm_12.dev}/bin/llvm-config"
+
#"LLVM_CONFIG=${llvm_12.dev}/bin/llvm-config"
"RUSTC_TARGET=${stdenv.targetPlatform.rust.rustcTarget}"
];
···
asl20
];
platforms = [ "x86_64-linux" ];
+
# rustc 1.54 only supports LLVM 12, which was removed from Nixpkgs.
+
# mrustc can bootstrap up to rustc 1.74, which supported LLVM 17,
+
# which has also been removed.
+
#
+
# 1.74 also shipped with the Cranelift backend, so perhaps that
+
# could be used instead? Alternatively, it may be possible to
+
# backport the upstream patches to support LLVM 18 to 1.74.
+
# Assuming LLVM 18 is still in Nixpkgs by the time you read this
+
# comment, anyway. But if not, then maybe mrustc has been updated
+
# to support newer rustc versions? Hope springs eternal.
+
#
+
# (Note that you still have to “draw the rest of the owl” to
+
# bootstrap the chain of rustc versions between this bootstrap
+
# and the version currently used in Nixpkgs, anyway, so this was
+
# already not useful for bootstrapping a Rust compiler for use with
+
# Nixpkgs without a lot of additional work. See Guix’s Rust
+
# bootstrap chain, or the non‐Rust minimal bootstrap in Guix and
+
# Nixpkgs, for inspiration.)
+
broken = true;
};
}
+6 -1
pkgs/development/haskell-modules/with-packages-wrapper.nix
···
+ postBuild;
preferLocalBuild = true;
passthru = {
-
inherit (ghc) version meta targetPrefix;
+
inherit (ghc) version targetPrefix;
hoogle = hoogleWithPackages';
···
Also note that withLLVM has been renamed to useLLVM for consistency with
the GHC Nix expressions.'';
+
};
+
pos = __curPos;
+
meta = ghc.meta // {
+
# To be fixed by <https://github.com/NixOS/nixpkgs/pull/440774>.
+
broken = useLLVM;
};
}
-84
pkgs/development/tools/analysis/ikos/default.nix
···
-
{
-
stdenv,
-
lib,
-
fetchFromGitHub,
-
cmake,
-
boost,
-
tbb,
-
gmp,
-
llvm,
-
clang,
-
sqlite,
-
python3,
-
ocamlPackages,
-
mpfr,
-
ppl,
-
doxygen,
-
graphviz,
-
}:
-
-
stdenv.mkDerivation rec {
-
pname = "ikos";
-
version = "3.5";
-
-
src = fetchFromGitHub {
-
owner = "NASA-SW-VnV";
-
repo = "ikos";
-
rev = "v${version}";
-
hash = "sha256-kqgGD0plTW0N30kD7Y8xOvGODplJbi37Wh6yYAkzNKI=";
-
};
-
-
nativeBuildInputs = [
-
cmake
-
python3.pkgs.setuptools
-
python3.pkgs.wheel
-
python3.pkgs.build
-
python3.pkgs.installer
-
python3.pkgs.wrapPython
-
];
-
-
buildInputs = [
-
boost
-
tbb
-
gmp
-
clang
-
llvm
-
sqlite
-
python3
-
ocamlPackages.apron
-
mpfr
-
ppl
-
doxygen
-
graphviz
-
];
-
-
propagatedBuildInputs = [
-
python3.pkgs.pygments
-
];
-
-
cmakeFlags = [
-
"-DAPRON_ROOT=${ocamlPackages.apron}"
-
"-DINSTALL_PYTHON_VIRTUALENV=off"
-
"-DPYTHON_VENV_EXECUTABLE=${python3}/bin/python"
-
];
-
-
postBuild = ''
-
make doc
-
${python3}/bin/python -m build --no-isolation --outdir dist/ --wheel analyzer/python
-
'';
-
-
postInstall = ''
-
${python3}/bin/python -m installer --prefix "$out" dist/*.whl
-
'';
-
-
postFixup = ''
-
wrapPythonPrograms
-
'';
-
-
meta = with lib; {
-
homepage = "https://github.com/NASA-SW-VnV/ikos";
-
description = "Static analyzer for C/C++ based on the theory of Abstract Interpretation";
-
license = licenses.nasa13;
-
maintainers = with maintainers; [ atnnn ];
-
};
-
}
+6
pkgs/test/default.nix
···
(filter (n: n != "llvmPackages_9"))
(filter (n: n != "llvmPackages_10"))
(filter (n: n != "llvmPackages_11"))
+
(filter (n: n != "llvmPackages_12"))
+
(filter (n: n != "llvmPackages_13"))
+
(filter (n: n != "llvmPackages_14"))
+
(filter (n: n != "llvmPackages_15"))
+
(filter (n: n != "llvmPackages_16"))
+
(filter (n: n != "llvmPackages_17"))
];
tests = lib.genAttrs pkgSets (
name:
+63 -18
pkgs/top-level/aliases.nix
···
beatsabermodmanager = throw "'beatsabermodmanager' has been removed due to lack of upstream maintainenance. Consider using 'bs-manager' instead"; # Added 2025-03-18
betterbird = throw "betterbird has been removed as there were insufficient maintainer resources to keep up with security updates"; # Added 2024-10-25
betterbird-unwrapped = throw "betterbird has been removed as there were insufficient maintainer resources to keep up with security updates"; # Added 2024-10-25
+
bfc = throw "bfc has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-10
bibata-extra-cursors = throw "bibata-cursors has been removed as it was broken"; # Added 2024-07-15
bitbucket-server-cli = throw "bitbucket-server-cli has been removed due to lack of maintenance upstream."; # Added 2025-05-27
bitcoin-abc = throw "bitcoin-abc has been removed due to a lack of maintanance"; # Added 2025-06-17
···
colloid-kde = throw "'colloid-kde' has been removed, as it is only compatible with Plasma 5, which is EOL"; # Added 2025-08-20
colorpicker = throw "'colorpicker' has been removed due to lack of maintenance upstream. Consider using 'xcolor', 'gcolor3', 'eyedropper' or 'gpick' instead"; # Added 2024-10-19
colorstorm = throw "'colorstorm' has been removed because it was unmaintained in nixpkgs and upstream was rewritten."; # Added 2025-06-15
+
cone = throw "cone has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-10
connman-ncurses = throw "'connman-ncurses' has been removed due to lack of maintenance upstream."; # Added 2025-05-27
copilot-language-server-fhs = lib.warnOnInstantiate "The package set `copilot-language-server-fhs` has been renamed to `copilot-language-server`." copilot-language-server; # Added 2025-09-07
copper = throw "'copper' has been removed, as it was broken since 22.11"; # Added 2025-08-22
···
cyber = throw "cyber has been removed, as it does not build with supported Zig versions"; # Added 2025-08-09
# these are for convenience, not for backward compat., and shouldn't expire until the package is deprecated.
-
clang9Stdenv = throw "clang9Stdenv has been removed from nixpkgs"; # Added 2024-04-08
-
clang12Stdenv = lowPrio llvmPackages_12.stdenv; # preserve, reason: see above
-
clang13Stdenv = lowPrio llvmPackages_13.stdenv; # preserve, reason: see above
-
clang14Stdenv = lowPrio llvmPackages_14.stdenv; # preserve, reason: see above
-
clang15Stdenv = lowPrio llvmPackages_15.stdenv; # preserve, reason: see above
-
clang16Stdenv = lowPrio llvmPackages_16.stdenv; # preserve, reason: see above
-
clang17Stdenv = lowPrio llvmPackages_17.stdenv; # preserve, reason: see above
clang18Stdenv = lowPrio llvmPackages_18.stdenv; # preserve, reason: see above
clang19Stdenv = lowPrio llvmPackages_19.stdenv; # preserve, reason: see above
-
clang-tools_9 = throw "clang-tools_9 has been removed from nixpkgs"; # Added 2024-04-08
-
clang_9 = throw "clang_9 has been removed from nixpkgs"; # Added 2024-04-08
-
-
clang-tools_12 = llvmPackages_12.clang-tools; # Added 2024-04-22
-
clang-tools_13 = llvmPackages_13.clang-tools; # Added 2024-04-22
-
clang-tools_14 = llvmPackages_14.clang-tools; # Added 2024-04-22
-
clang-tools_15 = llvmPackages_15.clang-tools; # Added 2024-04-22
-
clang-tools_16 = llvmPackages_16.clang-tools; # Added 2024-04-22
-
clang-tools_17 = llvmPackages_17.clang-tools; # Added 2024-04-22
clang-tools_18 = llvmPackages_18.clang-tools; # Added 2024-04-22
clang-tools_19 = llvmPackages_19.clang-tools; # Added 2024-08-21
···
### D ###
+
dale = throw "dale has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-10
dap = throw "'dap' has been removed because it doesn't compile and has been unmaintained since 2014"; # Added 2025-05-10
daq = throw "'daq' has been removed as it is unmaintained and broken. Snort2 has also been removed, which depended on this"; # Added 2025-05-21
darling = throw "'darling' has been removed due to vendoring Python2"; # Added 2025-05-10
···
hiddify-app = throw "hiddify-app has been removed, since it is unmaintained"; # added 2025-08-20
hll2390dw-cups = throw "The hll2390dw-cups package was dropped since it was unmaintained."; # Added 2024-06-21
hoarder = throw "'hoarder' has been renamed to 'karakeep'"; # Added 2025-04-21
+
hobbes = throw "hobbes has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-20
hmetis = throw "'hmetis' has been removed as it was unmaintained and the upstream was unavailable"; # Added 2025-05-05
hop-cli = throw "hop-cli has been removed as the service has been shut-down"; # Added 2024-08-13
hpp-fcl = coal; # Added 2024-11-15
···
ib-controller = throw "ib-controller has been removed from nixpkgs as it was broken"; # Added 2024-07-15
ibm-sw-tpm2 = throw "ibm-sw-tpm2 has been removed, as it was broken"; # Added 2025-08-25
icuReal = throw "icuReal has been removed from nixpkgs as a mistake"; # Added 2025-02-18
+
ikos = throw "ikos has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-10
imagemagick7Big = throw "'imagemagick7Big' has been renamed to/replaced by 'imagemagickBig'"; # Converted to throw 2024-10-17
imagemagick7 = throw "'imagemagick7' has been renamed to/replaced by 'imagemagick'"; # Converted to throw 2024-10-17
imagemagick7_light = throw "'imagemagick7_light' has been renamed to/replaced by 'imagemagick_light'"; # Converted to throw 2024-10-17
···
llvmPackages_git = (callPackages ../development/compilers/llvm { }).git; # Added 2024-08-02
+
llvmPackages_9 = throw "llvmPackages_9 has been removed from nixpkgs"; # Added 2024-04-08
+
llvm_9 = throw "llvm_9 has been removed from nixpkgs"; # Added 2024-04-08
lld_9 = throw "lld_9 has been removed from nixpkgs"; # Added 2024-04-08
lldb_9 = throw "lldb_9 has been removed from nixpkgs"; # Added 2024-04-08
-
llvmPackages_9 = throw "llvmPackages_9 has been removed from nixpkgs"; # Added 2024-04-08
-
llvm_9 = throw "llvm_9 has been removed from nixpkgs"; # Added 2024-04-08
+
clang_9 = throw "clang_9 has been removed from nixpkgs"; # Added 2024-04-08
+
clang9Stdenv = throw "clang9Stdenv has been removed from nixpkgs"; # Added 2024-04-08
+
clang-tools_9 = throw "clang-tools_9 has been removed from nixpkgs"; # Added 2024-04-08
+
+
llvmPackages_12 = throw "llvmPackages_12 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
llvm_12 = throw "llvm_12 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
lld_12 = throw "lld_12 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
lldb_12 = throw "lldb_12 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
clang_12 = throw "clang_12 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
clang12Stdenv = throw "clang12Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
clang-tools_12 = throw "clang-tools_12 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
+
llvmPackages_13 = throw "llvmPackages_13 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
llvm_13 = throw "llvm_13 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
lld_13 = throw "lld_13 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
lldb_13 = throw "lldb_13 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
clang_13 = throw "clang_13 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
clang13Stdenv = throw "clang13Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
clang-tools_13 = throw "clang-tools_13 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
+
llvmPackages_14 = throw "llvmPackages_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
llvm_14 = throw "llvm_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
lld_14 = throw "lld_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
lldb_14 = throw "lldb_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
clang_14 = throw "clang_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
clang14Stdenv = throw "clang14Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
clang-tools_14 = throw "clang-tools_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
+
+
llvmPackages_15 = throw "llvmPackages_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
+
llvm_15 = throw "llvm_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
+
lld_15 = throw "lld_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
+
lldb_15 = throw "lldb_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
+
clang_15 = throw "clang_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
+
clang15Stdenv = throw "clang15Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
+
clang-tools_15 = throw "clang-tools_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
+
+
llvmPackages_16 = throw "llvmPackages_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
llvm_16 = throw "llvm_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
lld_16 = throw "lld_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
lldb_16 = throw "lldb_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
mlir_16 = throw "mlir_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
clang_16 = throw "clang_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
clang16Stdenv = throw "clang16Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
clang-tools_16 = throw "clang-tools_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
+
llvmPackages_17 = throw "llvmPackages_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
llvm_17 = throw "llvm_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
lld_17 = throw "lld_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
lldb_17 = throw "lldb_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
mlir_17 = throw "mlir_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
clang_17 = throw "clang_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
clang17Stdenv = throw "clang17Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
+
clang-tools_17 = throw "clang-tools_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
lobster-two = throw "'lobster-two' has been renamed to/replaced by 'google-fonts'"; # Converted to throw 2024-10-17
loc = throw "'loc' has been removed due to lack of upstream maintenance. Consider 'tokei' as an alternative."; # Added 2025-01-25
···
oauth2_proxy = throw "'oauth2_proxy' has been renamed to/replaced by 'oauth2-proxy'"; # Converted to throw 2024-10-17
obliv-c = throw "obliv-c has been removed from Nixpkgs, as it has been unmaintained upstream for 4 years and does not build with supported GCC versions"; # Added 2025-08-18
ocis-bin = throw "ocis-bin has been renamed to ocis_5-bin'. Future major.minor versions will be made available as separate packages"; # Added 2025-03-30
+
oclgrind = throw "oclgrind has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-10
odoo15 = throw "odoo15 has been removed from nixpkgs as it is unsupported; migrate to a newer version of odoo"; # Added 2025-05-06
offrss = throw "offrss has been removed due to lack of upstream maintenance; consider using another rss reader"; # Added 2025-06-01
oil = lib.warnOnInstantiate "Oil has been replaced with the faster native C++ version and renamed to 'oils-for-unix'. See also https://github.com/oils-for-unix/oils/wiki/Oils-Deployments" oils-for-unix; # Added 2024-10-22
···
qcachegrind = throw "'qcachegrind' has been removed, as it depends on KDE Gear 5, which has reached EOL"; # Added 2025-08-20
qflipper = qFlipper; # Added 2022-02-11
qnial = throw "'qnial' has been removed due to failing to build and being unmaintained"; # Added 2025-06-26
+
qrscan = throw "qrscan has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-19
qscintilla = libsForQt5.qscintilla; # Added 2023-09-20
qscintilla-qt6 = qt6Packages.qscintilla; # Added 2023-09-20
qt-video-wlr = throw "'qt-video-wlr' has been removed, as it depends on KDE Gear 5, which has reached EOL"; # Added 2025-08-20
···
### W ###
w_scan = throw "'w_scan' has been removed due to lack of upstream maintenance"; # Added 2025-08-29
wakatime = wakatime-cli; # 2024-05-30
+
wavm = throw "wavm has been removed, as it does not build with supported LLVM versions"; # Added 2025-08-10
wal_e = throw "wal_e was removed as it is unmaintained upstream and depends on the removed boto package; upstream recommends using wal-g or pgbackrest"; # Added 2024-09-22
wapp = tclPackages.wapp; # Added 2024-10-02
wavebox = throw "'wavebox' has been removed due to lack of maintenance in nixpkgs"; # Added 2025-06-24
+1 -56
pkgs/top-level/all-packages.nix
···
compass = callPackage ../development/tools/compass { };
-
cone = callPackage ../development/compilers/cone {
-
llvmPackages = llvmPackages_13;
-
};
-
coreutils = callPackage ../tools/misc/coreutils { };
# The coreutils above are built with dependencies from
···
clang-manpages = llvmPackages.clang-manpages;
clang = llvmPackages.clang;
-
clang_12 = llvmPackages_12.clang;
-
clang_13 = llvmPackages_13.clang;
-
clang_14 = llvmPackages_14.clang;
-
clang_15 = llvmPackages_15.clang;
-
clang_16 = llvmPackages_16.clang;
-
clang_17 = llvmPackages_17.clang;
clang-tools = llvmPackages.clang-tools;
···
flutter327 = flutterPackages.v3_27;
flutter324 = flutterPackages.v3_24;
-
fpc = callPackage ../development/compilers/fpc {
-
# https://github.com/NixOS/nixpkgs/issues/416485
-
# TODO: remove when upstream issue is fixed:
-
# https://gitlab.com/freepascal.org/fpc/source/-/issues/41045
-
stdenv =
-
if stdenv.cc.isClang && stdenv.hostPlatform.isx86_64 then llvmPackages_17.stdenv else stdenv;
-
};
+
fpc = callPackage ../development/compilers/fpc { };
gambit = callPackage ../development/compilers/gambit { };
gambit-unstable = callPackage ../development/compilers/gambit/unstable.nix { };
···
};
lld = llvmPackages.lld;
-
lld_12 = llvmPackages_12.lld;
-
lld_13 = llvmPackages_13.lld;
-
lld_14 = llvmPackages_14.lld;
-
lld_15 = llvmPackages_15.lld;
-
lld_16 = llvmPackages_16.lld;
-
lld_17 = llvmPackages_17.lld;
lldb = llvmPackages.lldb;
-
lldb_12 = llvmPackages_12.lldb;
-
lldb_13 = llvmPackages_13.lldb;
-
lldb_14 = llvmPackages_14.lldb;
-
lldb_15 = llvmPackages_15.lldb;
-
lldb_16 = llvmPackages_16.lldb;
-
lldb_17 = llvmPackages_17.lldb;
llvm = llvmPackages.llvm;
-
llvm_12 = llvmPackages_12.llvm;
-
llvm_13 = llvmPackages_13.llvm;
-
llvm_14 = llvmPackages_14.llvm;
-
llvm_15 = llvmPackages_15.llvm;
-
llvm_16 = llvmPackages_16.llvm;
-
llvm_17 = llvmPackages_17.llvm;
-
-
mlir_16 = llvmPackages_16.mlir;
-
mlir_17 = llvmPackages_17.mlir;
flang = llvmPackages_20.flang;
libclc = llvmPackages.libclc;
···
(rec {
llvmPackagesSet = recurseIntoAttrs (callPackages ../development/compilers/llvm { });
-
llvmPackages_12 = llvmPackagesSet."12";
-
llvmPackages_13 = llvmPackagesSet."13";
-
llvmPackages_14 = llvmPackagesSet."14";
-
llvmPackages_15 = llvmPackagesSet."15";
-
llvmPackages_16 = llvmPackagesSet."16";
-
llvmPackages_17 = llvmPackagesSet."17";
-
llvmPackages_18 = llvmPackagesSet."18";
clang_18 = llvmPackages_18.clang;
lld_18 = llvmPackages_18.lld;
···
mkLLVMPackages = llvmPackagesSet.mkPackage;
})
-
llvmPackages_12
-
llvmPackages_13
-
llvmPackages_14
-
llvmPackages_15
-
llvmPackages_16
-
llvmPackages_17
llvmPackages_18
clang_18
lld_18
···
iaca_2_1 = callPackage ../development/tools/iaca/2.1.nix { };
iaca_3_0 = callPackage ../development/tools/iaca/3.0.nix { };
iaca = iaca_3_0;
-
-
ikos = callPackage ../development/tools/analysis/ikos {
-
inherit (llvmPackages_14) stdenv clang llvm;
-
tbb = tbb_2022;
-
};
include-what-you-use = callPackage ../development/tools/analysis/include-what-you-use {
llvmPackages = llvmPackages_20;
+13 -28
pkgs/top-level/haskell-packages.nix
···
# Use this rather than `rec { ... }` below for sake of overlays.
inherit (pkgs.haskell) compiler packages;
+
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_20;
+
llvmPackages = pkgs.llvmPackages_20;
+
in
{
lib = haskellLibUncomposable;
···
{
# Required to bootstrap 9.4.8.
ghc902Binary = callPackage ../development/compilers/ghc/9.0.2-binary.nix {
-
llvmPackages = pkgs.llvmPackages_20;
+
inherit llvmPackages;
};
ghc924Binary = callPackage ../development/compilers/ghc/9.2.4-binary.nix { };
···
# https://github.com/xattr/xattr/issues/44 and
# https://github.com/xattr/xattr/issues/55 are solved.
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
-
# Support range >= 10 && < 14
-
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_12;
-
llvmPackages = pkgs.llvmPackages_12;
+
inherit buildTargetLlvmPackages llvmPackages;
};
ghc94 = compiler.ghc948;
ghc963 = callPackage ../development/compilers/ghc/9.6.3.nix {
···
# https://github.com/xattr/xattr/issues/44 and
# https://github.com/xattr/xattr/issues/55 are solved.
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
-
# Support range >= 11 && < 16
-
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_15;
-
llvmPackages = pkgs.llvmPackages_15;
+
inherit buildTargetLlvmPackages llvmPackages;
};
ghc967 = callPackage ../development/compilers/ghc/9.6.7.nix {
bootPkgs = bb.packages.ghc924Binary;
···
# https://github.com/xattr/xattr/issues/44 and
# https://github.com/xattr/xattr/issues/55 are solved.
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
-
# Support range >= 11 && < 16
-
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_15;
-
llvmPackages = pkgs.llvmPackages_15;
+
inherit buildTargetLlvmPackages llvmPackages;
};
ghc96 = compiler.ghc967;
ghc984 = callPackage ../development/compilers/ghc/9.8.4.nix {
···
# https://github.com/xattr/xattr/issues/44 and
# https://github.com/xattr/xattr/issues/55 are solved.
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
-
# Support range >= 11 && < 16
-
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_15;
-
llvmPackages = pkgs.llvmPackages_15;
+
inherit buildTargetLlvmPackages llvmPackages;
};
ghc98 = compiler.ghc984;
ghc9101 = callPackage ../development/compilers/ghc/9.10.1.nix {
···
# https://github.com/xattr/xattr/issues/44 and
# https://github.com/xattr/xattr/issues/55 are solved.
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
-
# 2023-01-15: Support range >= 11 && < 16
-
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_15;
-
llvmPackages = pkgs.llvmPackages_15;
+
inherit buildTargetLlvmPackages llvmPackages;
};
ghc9102 = callPackage ../development/compilers/ghc/9.10.2.nix {
bootPkgs =
···
# https://github.com/xattr/xattr/issues/44 and
# https://github.com/xattr/xattr/issues/55 are solved.
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
-
# 2023-01-15: Support range >= 11 && < 16
-
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_15;
-
llvmPackages = pkgs.llvmPackages_15;
+
inherit buildTargetLlvmPackages llvmPackages;
};
ghc9103 = callPackage ../development/compilers/ghc/9.10.3.nix {
bootPkgs =
···
# https://github.com/xattr/xattr/issues/44 and
# https://github.com/xattr/xattr/issues/55 are solved.
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
-
# 2024-12-21: Support range >= 13 && < 20
-
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_19;
-
llvmPackages = pkgs.llvmPackages_19;
+
inherit buildTargetLlvmPackages llvmPackages;
};
ghc9122 = callPackage ../development/compilers/ghc/9.12.2.nix {
bootPkgs =
···
# https://github.com/xattr/xattr/issues/44 and
# https://github.com/xattr/xattr/issues/55 are solved.
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
-
# 2024-12-21: Support range >= 13 && < 20
-
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_19;
-
llvmPackages = pkgs.llvmPackages_19;
+
inherit buildTargetLlvmPackages llvmPackages;
};
ghc912 = compiler.ghc9122;
ghcHEAD = callPackage ../development/compilers/ghc/head.nix {
···
# https://github.com/xattr/xattr/issues/44 and
# https://github.com/xattr/xattr/issues/55 are solved.
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
-
# 2023-01-15: Support range >= 11 && < 16
-
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_18;
-
llvmPackages = pkgs.llvmPackages_18;
+
inherit buildTargetLlvmPackages llvmPackages;
};
# Starting from GHC 9, integer-{simple,gmp} is replaced by ghc-bignum