llvmPackages_13: drop

Emily 791fe23b 9b8a66c3

+1 -1
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 has been removed, as it has reached end‐of‐life upstream and is no longer supported.
+
- LLVM 12 and 13 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.
-235
pkgs/development/compilers/llvm/13/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})
pkgs/development/compilers/llvm/13/clang/purity.patch pkgs/development/compilers/llvm/14/clang/purity.patch
-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
pkgs/development/compilers/llvm/13/compiler-rt/X86-support-extension.patch pkgs/development/compilers/llvm/14/compiler-rt/X86-support-extension.patch
pkgs/development/compilers/llvm/13/compiler-rt/armv7l.patch pkgs/development/compilers/llvm/14/compiler-rt/armv7l.patch
pkgs/development/compilers/llvm/13/compiler-rt/codesign.patch pkgs/development/compilers/llvm/14/compiler-rt/codesign.patch
pkgs/development/compilers/llvm/13/compiler-rt/darwin-targetconditionals.patch pkgs/development/compilers/llvm/14/compiler-rt/darwin-targetconditionals.patch
-129
pkgs/development/compilers/llvm/13/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})
pkgs/development/compilers/llvm/13/compiler-rt/normalize-var.patch pkgs/development/compilers/llvm/14/compiler-rt/normalize-var.patch
-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()
-
-68
pkgs/development/compilers/llvm/13/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/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}")
pkgs/development/compilers/llvm/13/lldb/procfs.patch pkgs/development/compilers/llvm/14/lldb/procfs.patch
pkgs/development/compilers/llvm/13/lldb/resource-dir.patch pkgs/development/compilers/llvm/14/lldb/resource-dir.patch
-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)
pkgs/development/compilers/llvm/13/llvm/no-pipes.patch pkgs/development/compilers/llvm/14/llvm/no-pipes.patch
+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";
+12 -30
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
-
)
+
++ lib.optional (lib.versionOlder release_version "17") (fetchpatch {
+
name = "ignore-nostd-link.patch";
+
url = "https://github.com/llvm/llvm-project/commit/5b77e752dcd073846b89559d6c0e1a7699e58615.patch";
+
relative = "clang";
+
hash = "sha256-qzSAmoGY+7POkDhcGgQRPaNQ3+7PIcIc9cZuiE/eLkc=";
+
})
# Pass the correct path to libllvm
++ [
(replaceVars
-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
+1 -1
pkgs/development/compilers/llvm/common/common-let.nix
···
++ lib.platforms.wasi
++ lib.platforms.x86
++ lib.platforms.riscv
-
++ lib.optionals (lib.versionAtLeast release_version "14") lib.platforms.m68k
+
++ lib.platforms.m68k
++ lib.optionals (lib.versionAtLeast release_version "16") lib.platforms.loongarch64;
};
+1 -16
pkgs/development/compilers/llvm/common/compiler-rt/default.nix
···
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") ''
···
# Fix build on armv6l
./armv6-no-ldrexd-strexd.patch
]
-
++ lib.optional (lib.versionAtLeast release_version "14" && lib.versionOlder release_version "18") (
+
++ lib.optional (lib.versionOlder release_version "18") (
getVersionFile "compiler-rt/gnu-install-dirs.patch"
)
++ lib.optional (lib.versionOlder release_version "18") (fetchpatch {
···
(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.optionalString (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
+110 -188
pkgs/development/compilers/llvm/common/default.nix
···
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 (
+
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 =
-
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 (
+
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;
-
}
-
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") {
-
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 (
+
lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm
+
) "-fno-exceptions";
+
};
# This is an "oddly ordered" bootstrap just for Darwin. Probably
# don't want it otherwise.
···
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;
+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";
+7 -16
pkgs/development/compilers/llvm/common/libcxx/default.nix
···
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"
'')
···
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)"
-
''
-
)
+
(lib.optionalString (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
'';
-4
pkgs/development/compilers/llvm/common/libunwind/default.nix
···
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"
+11 -24
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;
···
];
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.optionals (lib.versionAtLeast release_version "15") [
(lib.cmakeFeature "LLD_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/lld")
]
++ [
···
]
++ 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";
+3 -12
pkgs/development/compilers/llvm/common/lldb/default.nix
···
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) ''
···
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;
+
++ [ ./gnu-install-dirs.patch ];
nativeBuildInputs = [
cmake
···
++ 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
];
···
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;
···
larger LLVM Project, such as the Clang expression parser and LLVM
disassembler.
'';
-
broken = lib.versionOlder release_version "14";
mainProgram = "lldb";
};
}
+12 -52
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,
···
''
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
# 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") ]
+
[ (getVersionFile "llvm/gnu-install-dirs.patch") ]
++ lib.optionals (lib.versionAtLeast release_version "15") [
# Running the tests involves invoking binaries (like `opt`) that depend on
# the LLVM dylibs and reference them by absolute install path (i.e. their
···
(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.versionOlder release_version "19")
# Add missing include headers to build against gcc-15:
# https://github.com/llvm/llvm-project/pull/101761
···
# 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;
-
})
+
++ lib.optionals (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 {
-
name = "base64-gcc-13.patch";
-
url = "https://github.com/llvm/llvm-project/commit/5e9be93566f39ee6cecd579401e453eccfbe81e5.patch";
-
hash = "sha256-PAwrVrvffPd7tphpwCkYiz+67szPRzRB2TXBvKfzQ7U=";
-
stripLen = 1;
+
url = "https://github.com/llvm/llvm-project/commit/2e1b838a889f9793d4bcd5dbfe10db9796b77143.patch";
+
relative = "llvm";
+
hash = "sha256-Ot45P/iwaR4hkcM3xtLwfryQNgHI6pv6ADjv98tgdZA=";
})
]
-
++
-
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
···
]
++ optional enablePFM libpfm; # exegesis
-
propagatedBuildInputs =
-
(lib.optional (
-
lib.versionAtLeast release_version "14" || stdenv.buildPlatform == stdenv.hostPlatform
-
) ncurses)
-
++ [ zlib ];
+
propagatedBuildInputs = [
+
ncurses
+
zlib
+
];
nativeCheckInputs = [
which
-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";
+83 -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;
-
-
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;
+
stdenv.mkDerivation (finalAttrs: {
+
pname = "openmp";
+
inherit version;
-
sourceRoot = "${finalAttrs.src.name}/openmp";
+
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;
-
outputs = [ "out" ] ++ lib.optionals (lib.versionAtLeast release_version "14") [ "dev" ];
+
sourceRoot = "${finalAttrs.src.name}/openmp";
-
patchFlags = if lib.versionOlder release_version "14" then [ "-p2" ] else null;
+
outputs = [
+
"out"
+
"dev"
+
];
-
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=";
-
}
-
);
+
# TODO: Remove on `staging`.
+
patchFlags = null;
-
nativeBuildInputs = [
-
cmake
-
python3.pythonOnBuildForHost
-
perl
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "15") [
-
ninja
-
]
-
++ lib.optionals (lib.versionAtLeast release_version "14") [
-
pkg-config
-
lit
+
patches =
+
lib.optional (lib.versionAtLeast release_version "15" && lib.versionOlder release_version "19") (
+
getVersionFile "openmp/fix-find-tool.patch"
+
)
+
++ lib.optional (lib.versionOlder release_version "18") (
+
getVersionFile "openmp/gnu-install-dirs.patch"
+
)
+
++ [
+
(getVersionFile "openmp/run-lit-directly.patch")
];
-
buildInputs = [
-
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
-
]
-
++ lib.optionals (ompdSupport && ompdGdbSupport) [
-
python3
-
];
+
nativeBuildInputs = [
+
cmake
+
python3.pythonOnBuildForHost
+
perl
+
]
+
++ lib.optionals (lib.versionAtLeast release_version "15") [
+
ninja
+
]
+
++ [
+
pkg-config
+
lit
+
];
-
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;
+
buildInputs = [
+
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
+
]
+
++ lib.optionals (ompdSupport && ompdGdbSupport) [
+
python3
+
];
-
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
+
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;
+
+
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
+
];
+
};
+
})
+9 -23
pkgs/development/compilers/llvm/common/patches.nix
···
{
"clang/gnu-install-dirs.patch" = [
{
-
before = "14";
-
path = ../13;
-
}
-
{
after = "19";
path = ../19;
}
···
}
{
before = "16";
-
path = ../13;
+
path = ../14;
}
];
"clang/aarch64-tblgen.patch" = [
···
after = "18";
path = ../18;
}
-
{
-
before = "14";
-
path = ../13;
-
}
];
"llvm/gnu-install-dirs.patch" = [
{
···
}
{
before = "18";
-
after = "14";
path = ../14;
}
];
···
}
{
before = "15";
-
path = ../13;
+
path = ../14;
}
];
"compiler-rt/armv6-scudo-libatomic.patch" = [
···
"compiler-rt/armv7l.patch" = [
{
before = "15";
-
path = ../13;
+
path = ../14;
}
];
"compiler-rt/gnu-install-dirs.patch" = [
{
-
before = "14";
-
path = ../13;
-
}
-
{
before = "15";
path = ../14;
}
···
];
"compiler-rt/darwin-targetconditionals.patch" = [
{
-
path = ../13;
+
path = ../14;
}
];
"compiler-rt/codesign.patch" = [
{
-
path = ../13;
+
path = ../14;
}
];
"compiler-rt/normalize-var.patch" = [
···
}
{
before = "16";
-
path = ../13;
+
path = ../14;
}
];
"lldb/procfs.patch" = [
···
}
{
before = "15";
-
path = ../13;
+
path = ../14;
}
];
"lldb/resource-dir.patch" = [
{
before = "16";
-
path = ../13;
+
path = ../14;
}
];
"llvm/no-pipes.patch" = [
{
before = "16";
-
path = ../13;
+
path = ../14;
}
];
"openmp/fix-find-tool.patch" = [
···
path = ../16;
}
{
-
after = "14";
before = "16";
path = ../14;
}
+9 -15
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;
-1
pkgs/development/compilers/llvm/default.nix
···
}@packageSetArgs:
let
versions = {
-
"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=";
+5 -17
pkgs/development/compilers/llvm/update.sh
···
readonly ATTRSET="llvmPackages_$VERSION_MAJOR"
-
if [ "$VERSION_MAJOR" -ge "14" ]; then
-
readonly SOURCES=(
-
"llvm.monorepoSrc"
-
)
-
else
-
readonly SOURCES=(
-
"llvm.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
+1
pkgs/test/default.nix
···
(filter (n: n != "llvmPackages_10"))
(filter (n: n != "llvmPackages_11"))
(filter (n: n != "llvmPackages_12"))
+
(filter (n: n != "llvmPackages_13"))
];
tests = lib.genAttrs pkgSets (
name:
+8 -2
pkgs/top-level/aliases.nix
···
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.
-
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
···
clang18Stdenv = lowPrio llvmPackages_18.stdenv; # preserve, reason: see above
clang19Stdenv = lowPrio llvmPackages_19.stdenv; # preserve, reason: see above
-
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_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
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
-6
pkgs/top-level/all-packages.nix
···
clang-manpages = llvmPackages.clang-manpages;
clang = llvmPackages.clang;
-
clang_13 = llvmPackages_13.clang;
clang_14 = llvmPackages_14.clang;
clang_15 = llvmPackages_15.clang;
clang_16 = llvmPackages_16.clang;
···
};
lld = llvmPackages.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_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_13 = llvmPackages_13.llvm;
llvm_14 = llvmPackages_14.llvm;
llvm_15 = llvmPackages_15.llvm;
llvm_16 = llvmPackages_16.llvm;
···
(rec {
llvmPackagesSet = recurseIntoAttrs (callPackages ../development/compilers/llvm { });
-
llvmPackages_13 = llvmPackagesSet."13";
llvmPackages_14 = llvmPackagesSet."14";
llvmPackages_15 = llvmPackagesSet."15";
llvmPackages_16 = llvmPackagesSet."16";
···
mkLLVMPackages = llvmPackagesSet.mkPackage;
})
-
llvmPackages_13
llvmPackages_14
llvmPackages_15
llvmPackages_16