llvmPackages_14: drop

This commit is contained in:
Emily
2025-08-10 06:12:15 +01:00
parent 791fe23b63
commit f470ea24b6
38 changed files with 351 additions and 1326 deletions
+1 -1
View File
@@ -26,7 +26,7 @@
- GCC 9, 10, 11, and 12 have been removed, as they have reached endoflife upstream and are no longer supported.
- LLVM 12 and 13 have been removed, as they have reached endoflife upstream and are no longer supported.
- LLVM 12, 13, and 14 have been removed, as they have reached endoflife 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.
@@ -1,50 +0,0 @@
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)
@@ -1,28 +0,0 @@
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
@@ -1,21 +0,0 @@
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)$")
@@ -1,65 +0,0 @@
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
@@ -1,31 +0,0 @@
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)
@@ -1,33 +0,0 @@
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
@@ -1,42 +0,0 @@
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()
@@ -1,21 +0,0 @@
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()
@@ -1,13 +0,0 @@
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)
@@ -1,22 +0,0 @@
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()
@@ -1,31 +0,0 @@
--- 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
@@ -1,220 +0,0 @@
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;
}
@@ -1,45 +0,0 @@
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}"
@@ -82,19 +82,13 @@ stdenv.mkDerivation (
})
# 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=";
})
++ lib.optional (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 {
@@ -117,8 +111,8 @@ stdenv.mkDerivation (
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.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
@@ -128,43 +122,41 @@ stdenv.mkDerivation (
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}")
]
++ 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)
]
# 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
@@ -203,39 +195,21 @@ stdenv.mkDerivation (
# 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
''
@@ -246,12 +220,7 @@ stdenv.mkDerivation (
);
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.
@@ -268,7 +237,6 @@ stdenv.mkDerivation (
++ lib.optional (!targetPlatform.isAarch64 || !targetPlatform.isLinux) "pacret"
++ lib.optional (
(targetPlatform.isAarch64 && (lib.versionOlder release_version "18.1"))
|| (targetPlatform.isFreeBSD && (lib.versionOlder release_version "15"))
|| !(targetPlatform.isLinux || targetPlatform.isFreeBSD)
|| !(
targetPlatform.isx86
@@ -277,10 +245,7 @@ stdenv.mkDerivation (
|| 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 (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs"
++ lib.optional (lib.versionOlder release_version "16") "strictflexarrays3"
++ (finalAttrs.passthru.hardeningUnsupportedFlags or [ ]);
};
@@ -303,35 +268,23 @@ stdenv.mkDerivation (
mainProgram = "clang";
};
}
// lib.optionalAttrs enableManpages (
{
pname = "clang-manpages";
// lib.optionalAttrs enableManpages {
pname = "clang-manpages";
installPhase = ''
mkdir -p $out/share/man/man1
# Manually install clang manpage
cp docs/man/*.1 $out/share/man/man1/
'';
ninjaFlags = [ "docs-clang-man" ];
outputs = [ "out" ];
installPhase = ''
mkdir -p $out/share/man/man1
# Manually install clang manpage
cp docs/man/*.1 $out/share/man/man1/
'';
doCheck = false;
outputs = [ "out" ];
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" ];
}
)
)
doCheck = false;
meta = llvm_meta // {
description = "man page for Clang ${version}";
};
}
)
@@ -1,75 +0,0 @@
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
@@ -1,52 +0,0 @@
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; \
@@ -72,64 +72,54 @@ stdenv.mkDerivation (finalAttrs: {
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.versionOlder release_version "18") (
getVersionFile "compiler-rt/gnu-install-dirs.patch"
)
++ lib.optional (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.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.versionOlder release_version "18") [
# Fix build on armv6l
./armv6-scudo-no-yield.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";
});
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
]
++ lib.optional (lib.versionOlder release_version "18") (
getVersionFile "compiler-rt/gnu-install-dirs.patch"
)
++ lib.optional (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.versionOlder release_version "18")
# Prevent a compilation error on darwin
(getVersionFile "compiler-rt/darwin-targetconditionals.patch")
++ [
# 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 "18") [
# Fix build on armv6l
./armv6-scudo-no-yield.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
@@ -214,8 +204,6 @@ stdenv.mkDerivation (finalAttrs: {
(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)
@@ -257,6 +257,13 @@ let
}
);
lldb-manpages = lowPrio (
tools.lldb.override {
enableManpages = true;
python3 = pkgs.python3; # don't use python-boot
}
);
# Below, is the LLVM bootstrapping logic. It handles building a
# fully LLVM toolchain from scratch. No GCC toolchain should be
# pulled in. As a consequence, it is very quick to build different
@@ -349,9 +356,7 @@ let
"-B${targetLlvmLibraries.compiler-rt-no-libc}/lib"
"-nostdlib++"
]
++ lib.optional (
lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm
) "-fno-exceptions";
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
};
clangNoLibcWithBasicRt = wrapCCWith rec {
@@ -364,9 +369,7 @@ let
"-rtlib=compiler-rt"
"-B${targetLlvmLibraries.compiler-rt-no-libc}/lib"
]
++ lib.optional (
lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm
) "-fno-exceptions";
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
};
clangNoLibcNoRt = wrapCCWith rec {
@@ -376,9 +379,7 @@ let
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";
nixSupport.cc-cflags = lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
};
# This is an "oddly ordered" bootstrap just for Darwin. Probably
@@ -392,24 +393,15 @@ let
extraBuildCommands = mkExtraBuildCommands0 cc;
}
# FIXME: This should be inside the `wrapCCWith` call.
// lib.optionalAttrs (
lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm
) { nixSupport.cc-cflags = [ "-fno-exceptions" ]; };
// 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 { };
}
@@ -42,8 +42,8 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
cmake
python3
ninja
]
++ (lib.optional (lib.versionAtLeast release_version "15") ninja)
++ (lib.optional isFullBuild python3Packages.pyyaml);
buildInputs = lib.optional isFullBuild linuxHeaders;
@@ -266,16 +266,9 @@ stdenv.mkDerivation (
// (
if (lib.versionOlder release_version "16" || lib.versionAtLeast release_version "17") then
{
postPatch =
(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
'';
postPatch = ''
cd runtimes
'';
}
else
{
@@ -32,30 +32,22 @@ stdenv.mkDerivation (
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"
''
+ lib.optionalString (lib.versionAtLeast release_version "15") ''
cp -r ${monorepoSrc}/llvm/utils "$out/llvm"
cp -r ${monorepoSrc}/runtimes "$out"
''
)
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"
@@ -64,34 +56,24 @@ stdenv.mkDerivation (
nativeBuildInputs = [
cmake
]
++ lib.optionals (lib.versionAtLeast release_version "15") [
ninja
python3
];
cmakeFlags = [
(lib.cmakeBool "LIBUNWIND_ENABLE_SHARED" enableShared)
(lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "libunwind")
]
++ lib.optional (lib.versionAtLeast release_version "15") (
lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "libunwind"
)
++ devExtraCmakeFlags;
prePatch =
lib.optionalString
(lib.versionAtLeast release_version "15" && (hasPatches || lib.versionOlder release_version "18"))
''
cd ../libunwind
chmod -R u+w .
'';
prePatch = lib.optionalString (hasPatches || lib.versionOlder release_version "18") ''
cd ../libunwind
chmod -R u+w .
'';
postPatch =
lib.optionalString
(lib.versionAtLeast release_version "15" && (hasPatches || lib.versionOlder release_version "18"))
''
cd ../runtimes
'';
postPatch = lib.optionalString (hasPatches || lib.versionOlder release_version "18") ''
cd ../runtimes
'';
postInstall =
lib.optionalString (enableShared && !stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isWindows)
@@ -38,9 +38,6 @@ stdenv.mkDerivation (finalAttrs: {
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"
)
@@ -54,20 +51,20 @@ stdenv.mkDerivation (finalAttrs: {
}
);
nativeBuildInputs = [ cmake ] ++ lib.optional (lib.versionAtLeast release_version "15") ninja;
nativeBuildInputs = [
cmake
ninja
];
buildInputs = [
libllvm
libxml2
];
cmakeFlags =
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;
# TODO: Remove on `staging`.
postPatch = "";
@@ -78,20 +78,7 @@ stdenv.mkDerivation (
}).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") [
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";
@@ -181,21 +168,17 @@ stdenv.mkDerivation (
++ lib.optionals (lib.versionAtLeast release_version "17") [
(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++")
@@ -203,7 +186,7 @@ stdenv.mkDerivation (
++ devExtraCmakeFlags;
doCheck = false;
doInstallCheck = lib.versionOlder release_version "15";
doInstallCheck = false;
# TODO: cleanup with mass-rebuild
installCheckPhase = ''
@@ -248,11 +231,10 @@ stdenv.mkDerivation (
// lib.optionalAttrs enableManpages {
pname = "lldb-manpages";
buildPhase = lib.optionalString (lib.versionOlder release_version "15") ''
make docs-lldb-man
'';
# TODO: Remove on `staging`.
buildPhase = "";
ninjaFlags = lib.optionals (lib.versionAtLeast release_version "15") [ "docs-lldb-man" ];
ninjaFlags = [ "docs-lldb-man" ];
propagatedBuildInputs = [ ];
@@ -125,7 +125,7 @@ stdenv.mkDerivation (
# 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") [
++ [
# 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).
@@ -240,10 +240,10 @@ stdenv.mkDerivation (
# 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
@@ -262,8 +262,8 @@ stdenv.mkDerivation (
# 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)
@@ -290,7 +290,7 @@ stdenv.mkDerivation (
nativeCheckInputs = [
which
]
++ lib.optional (stdenv.hostPlatform.isDarwin && lib.versionAtLeast release_version "15") sysctl;
++ lib.optional stdenv.hostPlatform.isDarwin sysctl;
postPatch =
optionalString stdenv.hostPlatform.isDarwin (
@@ -301,119 +301,113 @@ stdenv.mkDerivation (
+
# 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:
(
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.
#
# 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?
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)" ""
''
+
# 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
''
+
# fails when run in sandbox
optionalString (!stdenv.hostPlatform.isx86 && lib.versionAtLeast release_version "18") ''
substituteInPlace unittests/Support/VirtualFileSystemTest.cpp \
--replace-fail "PhysicalFileSystemWorkingDirFailure" "DISABLED_PhysicalFileSystemWorkingDirFailure"
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.
#
# 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?
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)" ""
''
+
# fails when run in sandbox
optionalString (!stdenv.hostPlatform.isx86 && lib.versionAtLeast release_version "18") ''
substituteInPlace unittests/Support/VirtualFileSystemTest.cpp \
--replace-fail "PhysicalFileSystemWorkingDirFailure" "DISABLED_PhysicalFileSystemWorkingDirFailure"
''
)
+
# 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)" ""
optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86) (
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
''
)
)
''
+
# 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
''
@@ -438,11 +432,9 @@ stdenv.mkDerivation (
)
+
# timing-based tests are trouble
lib.optionalString
(lib.versionAtLeast release_version "15" && lib.versionOlder release_version "17")
''
rm utils/lit/tests/googletest-timeout.py
''
lib.optionalString (lib.versionOlder release_version "17") ''
rm utils/lit/tests/googletest-timeout.py
''
+
# valgrind unhappy with musl or glibc, but fails w/musl only
optionalString stdenv.hostPlatform.isMusl ''
@@ -496,6 +488,40 @@ stdenv.mkDerivation (
)
'';
# 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
@@ -512,22 +538,12 @@ stdenv.mkDerivation (
#
# 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
++ [
@@ -617,19 +633,9 @@ stdenv.mkDerivation (
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
@@ -649,7 +655,6 @@ stdenv.mkDerivation (
doCheck =
!isDarwinBootstrap
&& !stdenv.hostPlatform.isAarch32
&& (if lib.versionOlder release_version "15" then stdenv.hostPlatform.isLinux else true)
&& (
!stdenv.hostPlatform.isx86_32 # TODO: why
)
@@ -682,92 +687,23 @@ stdenv.mkDerivation (
'';
};
}
// 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.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}";
};
}
)
@@ -50,9 +50,7 @@ stdenv.mkDerivation (finalAttrs: {
patchFlags = null;
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 "19") (getVersionFile "openmp/fix-find-tool.patch")
++ lib.optional (lib.versionOlder release_version "18") (
getVersionFile "openmp/gnu-install-dirs.patch"
)
@@ -64,11 +62,7 @@ stdenv.mkDerivation (finalAttrs: {
cmake
python3.pythonOnBuildForHost
perl
]
++ lib.optionals (lib.versionAtLeast release_version "15") [
ninja
]
++ [
pkg-config
lit
];
@@ -12,13 +12,8 @@
}
{
before = "17";
after = "15";
path = ../15;
}
{
before = "16";
path = ../14;
}
];
"clang/aarch64-tblgen.patch" = [
{
@@ -72,13 +67,12 @@
}
{
before = "18";
path = ../14;
path = ../15;
}
];
"llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch" = [
{
before = "17";
after = "15";
path = ../15;
}
{
@@ -99,26 +93,19 @@
];
"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;
}
];
"compiler-rt/X86-support-extension.patch" = [
{
after = "15";
path = ../15;
}
{
before = "15";
path = ../14;
}
];
"compiler-rt/armv6-scudo-libatomic.patch" = [
{
@@ -126,28 +113,12 @@
path = ../19;
}
{
after = "15";
before = "19";
path = ../15;
}
{
before = "15";
path = ../14;
}
];
"compiler-rt/armv7l.patch" = [
{
before = "15";
path = ../14;
}
];
"compiler-rt/gnu-install-dirs.patch" = [
{
before = "15";
path = ../14;
}
{
after = "15";
before = "17";
path = ../15;
}
@@ -158,12 +129,7 @@
];
"compiler-rt/darwin-targetconditionals.patch" = [
{
path = ../14;
}
];
"compiler-rt/codesign.patch" = [
{
path = ../14;
path = ../15;
}
];
"compiler-rt/normalize-var.patch" = [
@@ -173,29 +139,24 @@
}
{
before = "16";
path = ../14;
path = ../15;
}
];
"lldb/procfs.patch" = [
{
after = "15";
path = ../15;
}
{
before = "15";
path = ../14;
}
];
"lldb/resource-dir.patch" = [
{
before = "16";
path = ../14;
path = ../15;
}
];
"llvm/no-pipes.patch" = [
{
before = "16";
path = ../14;
path = ../15;
}
];
"openmp/fix-find-tool.patch" = [
@@ -212,7 +173,7 @@
}
{
before = "16";
path = ../14;
path = ../15;
}
];
"libclc/use-default-paths.patch" = [
@@ -54,18 +54,14 @@ let
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;
@@ -22,7 +22,6 @@
}@packageSetArgs:
let
versions = {
"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=";
+1
View File
@@ -18,6 +18,7 @@ with pkgs;
(filter (n: n != "llvmPackages_11"))
(filter (n: n != "llvmPackages_12"))
(filter (n: n != "llvmPackages_13"))
(filter (n: n != "llvmPackages_14"))
];
tests = lib.genAttrs pkgSets (
name:
+8 -2
View File
@@ -698,14 +698,12 @@ mapAliases {
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.
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_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
@@ -1501,6 +1499,14 @@ mapAliases {
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
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
loco-cli = loco; # Added 2025-02-24
-6
View File
@@ -4633,7 +4633,6 @@ with pkgs;
clang-manpages = llvmPackages.clang-manpages;
clang = llvmPackages.clang;
clang_14 = llvmPackages_14.clang;
clang_15 = llvmPackages_15.clang;
clang_16 = llvmPackages_16.clang;
clang_17 = llvmPackages_17.clang;
@@ -5363,19 +5362,16 @@ with pkgs;
};
lld = llvmPackages.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_14 = llvmPackages_14.lldb;
lldb_15 = llvmPackages_15.lldb;
lldb_16 = llvmPackages_16.lldb;
lldb_17 = llvmPackages_17.lldb;
llvm = llvmPackages.llvm;
llvm_14 = llvmPackages_14.llvm;
llvm_15 = llvmPackages_15.llvm;
llvm_16 = llvmPackages_16.llvm;
llvm_17 = llvmPackages_17.llvm;
@@ -5394,7 +5390,6 @@ with pkgs;
(rec {
llvmPackagesSet = recurseIntoAttrs (callPackages ../development/compilers/llvm { });
llvmPackages_14 = llvmPackagesSet."14";
llvmPackages_15 = llvmPackagesSet."15";
llvmPackages_16 = llvmPackagesSet."16";
llvmPackages_17 = llvmPackagesSet."17";
@@ -5430,7 +5425,6 @@ with pkgs;
mkLLVMPackages = llvmPackagesSet.mkPackage;
})
llvmPackages_14
llvmPackages_15
llvmPackages_16
llvmPackages_17