llvmPackages_15: drop

This commit is contained in:
Emily
2025-09-14 19:03:24 +01:00
parent f470ea24b6
commit 77acbe1f9c
39 changed files with 108 additions and 910 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, 13, and 14 have been removed, as they have reached endoflife upstream and are no longer supported.
- LLVM 12, 13, 14, and 15 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,105 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c27beec313d7..480f13e73c9f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,15 +78,17 @@ if(CLANG_BUILT_STANDALONE)
if (NOT LLVM_CONFIG_FOUND)
# Pull values from LLVMConfig.cmake. We can drop this once the llvm-config
# path is removed.
- set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}")
+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
# N.B. this is just a default value, the CACHE PATHs below can be overriden.
set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}")
set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}")
+ else()
+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
endif()
- set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to llvm/include")
+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")
set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree")
set(LLVM_TOOLS_BINARY_DIR "${TOOLS_BINARY_DIR}" CACHE PATH "Path to llvm/bin")
@@ -128,7 +130,7 @@ if(CLANG_BUILT_STANDALONE)
set(LLVM_INCLUDE_TESTS ON)
endif()
- include_directories("${LLVM_BINARY_DIR}/include" "${LLVM_MAIN_INCLUDE_DIR}")
+ include_directories(${LLVM_INCLUDE_DIRS})
link_directories("${LLVM_LIBRARY_DIR}")
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake
index 21ac332e4f5f..b16c314bd1e2 100644
--- a/cmake/modules/AddClang.cmake
+++ b/cmake/modules/AddClang.cmake
@@ -119,8 +119,8 @@ macro(add_clang_library name)
install(TARGETS ${lib}
COMPONENT ${lib}
${export_to_clangtargets}
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
if (NOT LLVM_ENABLE_IDE)
diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
index 6e2060991b92..b9bc930d26b8 100644
--- a/lib/Headers/CMakeLists.txt
+++ b/lib/Headers/CMakeLists.txt
@@ -420,7 +420,7 @@ add_header_target("openmp-resource-headers" ${openmp_wrapper_files})
add_header_target("windows-resource-headers" ${windows_only_files})
add_header_target("utility-resource-headers" ${utility_files})
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
+set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
#############################################################
# Install rules for the catch-all clang-resource-headers target
diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
index 8d95d0900e8c..ebc70ff7526d 100644
--- a/tools/libclang/CMakeLists.txt
+++ b/tools/libclang/CMakeLists.txt
@@ -180,7 +180,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS})
COMPONENT
libclang-python-bindings
DESTINATION
- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
+ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
endforeach()
if(NOT LLVM_ENABLE_IDE)
add_custom_target(libclang-python-bindings)
diff --git a/tools/scan-build-py/CMakeLists.txt b/tools/scan-build-py/CMakeLists.txt
index 061dc7ef4dd9..adc54b2edc32 100644
--- a/tools/scan-build-py/CMakeLists.txt
+++ b/tools/scan-build-py/CMakeLists.txt
@@ -88,7 +88,7 @@ foreach(lib ${LibScanbuild})
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib})
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib})
install(PROGRAMS lib/libscanbuild/${lib}
- DESTINATION lib/libscanbuild
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild"
COMPONENT scan-build-py)
endforeach()
@@ -106,7 +106,7 @@ foreach(resource ${LibScanbuildResources})
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource})
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource})
install(PROGRAMS lib/libscanbuild/resources/${resource}
- DESTINATION lib/libscanbuild/resources
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild/resources"
COMPONENT scan-build-py)
endforeach()
@@ -122,7 +122,7 @@ foreach(lib ${LibEar})
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib})
list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib})
install(PROGRAMS lib/libear/${lib}
- DESTINATION lib/libear
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libear"
COMPONENT scan-build-py)
endforeach()
@@ -1,16 +0,0 @@
diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index f1f46fb9599c..6f19e69507ba 100644
--- a/cmake/Modules/CompilerRTUtils.cmake
+++ b/cmake/Modules/CompilerRTUtils.cmake
@@ -302,8 +302,9 @@ macro(load_llvm_config)
# Get some LLVM variables from LLVMConfig.
include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
- set(LLVM_LIBRARY_OUTPUT_INTDIR
- ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
+ get_filename_component(LLVM_LIBRARY_OUTPUT_INTDIR
+ ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}
+ REALPATH)
endif()
endmacro()
@@ -1,46 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dcc649629a4b..58dca54642e4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,13 +70,15 @@ if(LLD_BUILT_STANDALONE)
if (NOT LLVM_CONFIG_FOUND)
# Pull values from LLVMConfig.cmake. We can drop this once the llvm-config
# path is removed.
- set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}")
+ set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
# N.B. this is just a default value, the CACHE PATHs below can be overridden.
set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
+ else()
+ set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
endif()
- set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to llvm/include")
+ set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed")
set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")
set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree")
@@ -95,7 +97,7 @@ if(LLD_BUILT_STANDALONE)
set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
- include_directories("${LLVM_BINARY_DIR}/include" ${LLVM_INCLUDE_DIRS})
+ include_directories(${LLVM_INCLUDE_DIRS})
link_directories(${LLVM_LIBRARY_DIRS})
if(LLVM_INCLUDE_TESTS)
diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake
index d3924f7243d4..42a7cd62281c 100644
--- a/cmake/modules/AddLLD.cmake
+++ b/cmake/modules/AddLLD.cmake
@@ -18,8 +18,8 @@ macro(add_lld_library name)
install(TARGETS ${name}
COMPONENT ${name}
${export_to_lldtargets}
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
@@ -1,46 +0,0 @@
--- a/source/Plugins/Process/Linux/Procfs.h
+++ b/source/Plugins/Process/Linux/Procfs.h
@@ -10,6 +10,13 @@
// sys/procfs.h on Android/Linux for all supported architectures.
#include <sys/ptrace.h>
+#include <asm/ptrace.h>
+
+// on i686 preprocessor symbols with these register names are defined as
+// numeric constants; these symbols clash with identifier names used in
+// `llvm/Support/VirtualFileSystem.h` and `llvm/ADT/SmallVector.h`
+#undef FS
+#undef CS
#include "lldb/lldb-types.h"
@@ -17,23 +24,13 @@
#include <vector>
-#ifdef __ANDROID__
-#if defined(__arm64__) || defined(__aarch64__)
-typedef unsigned long elf_greg_t;
-typedef elf_greg_t
- elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
-typedef struct user_fpsimd_state elf_fpregset_t;
-#ifndef NT_FPREGSET
-#define NT_FPREGSET NT_PRFPREG
-#endif // NT_FPREGSET
-#elif defined(__mips__)
-#ifndef NT_FPREGSET
-#define NT_FPREGSET NT_PRFPREG
-#endif // NT_FPREGSET
-#endif
-#else // __ANDROID__
+#if !defined(__GLIBC__) && defined(__powerpc__)
+#define pt_regs musl_pt_regs
+#include <sys/procfs.h>
+#undef pt_regs
+#else
#include <sys/procfs.h>
-#endif // __ANDROID__
+#endif
namespace lldb_private {
namespace process_linux {
@@ -1,13 +0,0 @@
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index 37364341ff8b..7f74c1a3e257 100644
--- a/cmake/modules/LLDBConfig.cmake
+++ b/cmake/modules/LLDBConfig.cmake
@@ -257,7 +257,7 @@ if (NOT TARGET clang-resource-headers)
# Iterate over the possible places where the external resource directory
# could be and pick the first that exists.
foreach(CANDIDATE "${Clang_DIR}/../.." "${LLVM_DIR}" "${LLVM_LIBRARY_DIRS}"
- "${LLVM_BUILD_LIBRARY_DIR}"
+ "${LLVM_BUILD_LIBRARY_DIR}" "@clangLibDir@"
"${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}")
# Build the resource directory path by appending 'clang/<version number>'.
set(CANDIDATE_RESOURCE_DIR "${CANDIDATE}/clang/${LLDB_CLANG_RESOURCE_DIR_NAME}")
@@ -1,138 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 45399dc0537e..5d946e9e6583 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -942,7 +942,7 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "")
add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime)
install(TARGETS tf_xla_runtime EXPORT LLVMExports
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime)
# Once we add more modules, we should handle this more automatically.
if (DEFINED LLVM_OVERRIDE_MODEL_HEADER_INLINERSIZEMODEL)
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 057431208322..56f0dcb258da 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -844,8 +844,8 @@ macro(add_llvm_library name)
get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella})
install(TARGETS ${name}
${export_to_llvmexports}
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name})
if (NOT LLVM_ENABLE_IDE)
@@ -2007,7 +2007,7 @@ function(llvm_install_library_symlink name dest type)
set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX})
set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX})
- set(output_dir lib${LLVM_LIBDIR_SUFFIX})
+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
if(WIN32 AND "${type}" STREQUAL "SHARED")
set(output_dir "${CMAKE_INSTALL_BINDIR}")
endif()
@@ -2271,15 +2271,15 @@ function(llvm_setup_rpath name)
if (APPLE)
set(_install_name_dir INSTALL_NAME_DIR "@rpath")
- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
+ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS)
# $ORIGIN is not interpreted at link time by aix ld.
# Since BUILD_SHARED_LIBS is only recommended for use by developers,
# hardcode the rpath to build/install lib dir first in this mode.
# FIXME: update this when there is better solution.
- set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
elseif(UNIX)
- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
+ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
set_property(TARGET ${name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,-z,origin ")
diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
index 891c9e6d618c..8d963f3b0069 100644
--- a/cmake/modules/AddOCaml.cmake
+++ b/cmake/modules/AddOCaml.cmake
@@ -147,9 +147,9 @@ function(add_ocaml_library name)
endforeach()
if( APPLE )
- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}")
+ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
elseif( UNIX )
- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}")
+ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
endif()
list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}")
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
index d4b0ab959148..26ed981fd09f 100644
--- a/cmake/modules/CMakeLists.txt
+++ b/cmake/modules/CMakeLists.txt
@@ -128,7 +128,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS
)
list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS)
-extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}")
+extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}")
set(LLVM_CONFIG_LIBRARY_DIRS
"${LLVM_CONFIG_LIBRARY_DIR}"
# FIXME: Should there be other entries here?
diff --git a/docs/CMake.rst b/docs/CMake.rst
index 879b7b231d4c..9c31d14e8950 100644
--- a/docs/CMake.rst
+++ b/docs/CMake.rst
@@ -250,7 +250,7 @@ description is in `LLVM-related variables`_ below.
**LLVM_LIBDIR_SUFFIX**:STRING
Extra suffix to append to the directory where libraries are to be
installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
- to install libraries to ``/usr/lib64``.
+ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``.
**LLVM_PARALLEL_{COMPILE,LINK}_JOBS**:STRING
Building the llvm toolchain can use a lot of resources, particularly
@@ -284,6 +284,10 @@ manual, or execute ``cmake --help-variable VARIABLE_NAME``.
The path to install executables, relative to the *CMAKE_INSTALL_PREFIX*.
Defaults to "bin".
+**CMAKE_INSTALL_LIBDIR**:PATH
+ The path to install libraries, relative to the *CMAKE_INSTALL_PREFIX*.
+ Defaults to "lib".
+
**CMAKE_INSTALL_INCLUDEDIR**:PATH
The path to install header files, relative to the *CMAKE_INSTALL_PREFIX*.
Defaults to "include".
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
index 370005cd8d7d..7e790bc52111 100644
--- a/tools/llvm-config/BuildVariables.inc.in
+++ b/tools/llvm-config/BuildVariables.inc.in
@@ -23,6 +23,7 @@
#define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
#define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@"
#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
#define LLVM_INSTALL_PACKAGE_DIR "@LLVM_INSTALL_PACKAGE_DIR@"
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 2c6c55f89d38..f6d2068a0827 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -369,7 +369,11 @@ int main(int argc, char **argv) {
sys::fs::make_absolute(ActivePrefix, Path);
ActiveBinDir = std::string(Path.str());
}
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
+ {
+ SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX);
+ sys::fs::make_absolute(ActivePrefix, Path);
+ ActiveLibDir = std::string(Path.str());
+ }
{
SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR);
sys::fs::make_absolute(ActivePrefix, Path);
@@ -1,26 +0,0 @@
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py
index 0242e0b75af3..d732011306f7 100644
--- a/utils/lit/lit/TestRunner.py
+++ b/utils/lit/lit/TestRunner.py
@@ -1029,6 +1029,12 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
f.write('@echo off\n')
f.write('\n@if %ERRORLEVEL% NEQ 0 EXIT\n'.join(commands))
else:
+ # This env var is *purged* when invoking subprocesses so we have to
+ # manually set it from within the bash script in order for the commands
+ # in run lines to see this var:
+ if "DYLD_LIBRARY_PATH" in test.config.environment:
+ f.write(f'export DYLD_LIBRARY_PATH="{test.config.environment["DYLD_LIBRARY_PATH"]}"\n')
+
for i, ln in enumerate(commands):
match = re.match(kPdbgRegex, ln)
if match:
@@ -1363,7 +1369,7 @@ def applySubstitutions(script, substitutions, conditions={},
return processed
process = processLine if recursion_limit is None else processLineToFixedPoint
-
+
return [unescapePercents(process(ln)) for ln in script]
@@ -1,79 +0,0 @@
diff --git a/test/Unit/lit.cfg.py b/test/Unit/lit.cfg.py
index 81e8dc04acea..479ff95681e2 100644
--- a/test/Unit/lit.cfg.py
+++ b/test/Unit/lit.cfg.py
@@ -3,6 +3,7 @@
# Configuration file for the 'lit' test runner.
import os
+import platform
import subprocess
import lit.formats
@@ -55,3 +56,26 @@ if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
# Win32 may use %SYSTEMDRIVE% during file system shell operations, so propogate.
if sys.platform == 'win32' and 'SYSTEMDRIVE' in os.environ:
config.environment['SYSTEMDRIVE'] = os.environ['SYSTEMDRIVE']
+
+# Add the LLVM dynamic libs to the platform-specific loader search path env var:
+#
+# TODO: this is copied from `clang`'s `lit.cfg.py`; should unify..
+def find_shlibpath_var():
+ if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'SunOS']:
+ yield 'LD_LIBRARY_PATH'
+ elif platform.system() == 'Darwin':
+ yield 'DYLD_LIBRARY_PATH'
+ elif platform.system() == 'Windows':
+ yield 'PATH'
+ elif platform.system() == 'AIX':
+ yield 'LIBPATH'
+
+for shlibpath_var in find_shlibpath_var():
+ shlibpath = os.path.pathsep.join(
+ (config.shlibdir,
+ config.environment.get(shlibpath_var, '')))
+ config.environment[shlibpath_var] = shlibpath
+ break
+else:
+ lit_config.warning("unable to inject shared library path on '{}'"
+ .format(platform.system()))
diff --git a/test/lit.cfg.py b/test/lit.cfg.py
index 75a38b4c5dad..856fc75c9d74 100644
--- a/test/lit.cfg.py
+++ b/test/lit.cfg.py
@@ -42,6 +42,26 @@ llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
llvm_config.with_system_environment(
['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP'])
+# Add the LLVM dynamic libs to the platform-specific loader search path env var:
+#
+# TODO: this is copied from `clang`'s `lit.cfg.py`; should unify..
+def find_shlibpath_var():
+ if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'SunOS']:
+ yield 'LD_LIBRARY_PATH'
+ elif platform.system() == 'Darwin':
+ yield 'DYLD_LIBRARY_PATH'
+ elif platform.system() == 'Windows':
+ yield 'PATH'
+ elif platform.system() == 'AIX':
+ yield 'LIBPATH'
+
+for shlibpath_var in find_shlibpath_var():
+ shlibpath = config.llvm_shlib_dir
+ llvm_config.with_environment(shlibpath_var, shlibpath, append_path = True)
+ break
+else:
+ lit_config.warning("unable to inject shared library path on '{}'"
+ .format(platform.system()))
# Set up OCAMLPATH to include newly built OCaml libraries.
top_ocaml_lib = os.path.join(config.llvm_lib_dir, 'ocaml')
@@ -318,7 +338,7 @@ def have_cxx_shared_library():
try:
readobj_cmd = subprocess.Popen(
- [readobj_exe, '--needed-libs', readobj_exe], stdout=subprocess.PIPE)
+ [readobj_exe, '--needed-libs', readobj_exe], stdout=subprocess.PIPE, env=config.environment)
except OSError:
print('could not exec llvm-readobj')
return False
@@ -1,19 +0,0 @@
diff --git a/test/Bindings/Go/lit.local.cfg b/test/Bindings/Go/lit.local.cfg
index 91a0ad89..4da83a1a 100644
--- a/test/Bindings/Go/lit.local.cfg
+++ b/test/Bindings/Go/lit.local.cfg
@@ -1,5 +1,4 @@
import os
-import pipes
import shlex
import sys
@@ -56,7 +55,7 @@ def fixup_compiler_path(compiler):
except (AttributeError, OSError):
pass
- return ' '.join([pipes.quote(arg) for arg in args])
+ return ' '.join([shlex.quote(arg) for arg in args])
config.environment['CC'] = fixup_compiler_path(config.host_cc)
config.environment['CXX'] = fixup_compiler_path(config.host_cxx)
@@ -1,18 +0,0 @@
diff --git a/libomptarget/DeviceRTL/CMakeLists.txt b/libomptarget/DeviceRTL/CMakeLists.txt
index ce66214822a2..6ab7b33c95da 100644
--- a/libomptarget/DeviceRTL/CMakeLists.txt
+++ b/libomptarget/DeviceRTL/CMakeLists.txt
@@ -27,10 +27,10 @@ endif()
if (LLVM_DIR)
# Builds that use pre-installed LLVM have LLVM_DIR set.
# A standalone or LLVM_ENABLE_RUNTIMES=openmp build takes this route
- find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
+ find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR})
find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR}
- NO_DEFAULT_PATH)
- find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
+ )
+ find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR})
if ((NOT CLANG_TOOL) OR (NOT LINK_TOOL) OR (NOT OPT_TOOL))
libomptarget_say("Not building DeviceRTL. Missing clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL} or opt: ${OPT_TOOL}")
return()
@@ -1,22 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b6ddbe90516d..311ab1d50e7f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,7 +29,7 @@ if (OPENMP_STANDALONE_BUILD)
set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING
"Suffix of lib installation directory, e.g. 64 => lib64")
# Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR.
- set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}")
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}")
# Group test settings.
set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
@@ -40,7 +40,7 @@ if (OPENMP_STANDALONE_BUILD)
else()
set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
# If building in tree, we honor the same install suffix LLVM uses.
- set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
+ set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
if (NOT MSVC)
set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
@@ -1,12 +0,0 @@
diff --git a/cmake/OpenMPTesting.cmake b/cmake/OpenMPTesting.cmake
--- a/cmake/OpenMPTesting.cmake
+++ b/cmake/OpenMPTesting.cmake
@@ -185,7 +185,7 @@ function(add_openmp_testsuite target comment)
if (${OPENMP_STANDALONE_BUILD})
set(LIT_ARGS ${OPENMP_LIT_ARGS} ${ARG_ARGS})
add_custom_target(${target}
- COMMAND ${PYTHON_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS}
+ COMMAND ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS}
COMMENT ${comment}
DEPENDS ${ARG_DEPENDS}
USES_TERMINAL
@@ -1,13 +0,0 @@
diff --git a/lib/Driver/ToolChains/CommonArgs.cpp b/lib/Driver/ToolChains/CommonArgs.cpp
index 6b6e276b8ce7..7896542a1202 100644
--- a/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/lib/Driver/ToolChains/CommonArgs.cpp
@@ -409,7 +409,7 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
SmallString<1024> Plugin;
llvm::sys::path::native(
- Twine(D.Dir) + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold" + Suffix,
+ Twine("@libllvmLibdir@" "/LLVMgold") + Suffix,
Plugin);
CmdArgs.push_back(Args.MakeArgString(Plugin));
}
@@ -60,26 +60,10 @@ stdenv.mkDerivation (
})
# Pass the correct path to libllvm
++ [
(replaceVars
(
if (lib.versionOlder release_version "16") then
./clang-11-15-LLVMgold-path.patch
else
./clang-at-least-16-LLVMgold-path.patch
)
{
libllvmLibdir = "${libllvm.lib}/lib";
}
)
(replaceVars ./clang-at-least-16-LLVMgold-path.patch {
libllvmLibdir = "${libllvm.lib}/lib";
})
]
# Backport version logic from Clang 16. This is needed by the following patch.
++ lib.optional (lib.versions.major release_version == "15") (fetchpatch {
name = "clang-darwin-Use-consistent-version-define-stringifying-logic.patch";
url = "https://github.com/llvm/llvm-project/commit/60a33ded751c86fff9ac1c4bdd2b341fbe4b0649.patch?full_index=1";
includes = [ "lib/Basic/Targets/OSTargets.cpp" ];
stripLen = 1;
hash = "sha256-YVTSg5eZLz3po2AUczPNXCK26JA3CuTh6Iqp7hAAKIs=";
})
# Backport `__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__` support from Clang 17.
# This is needed by newer SDKs (14+).
++ lib.optional (lib.versionOlder (lib.versions.major release_version) "17") (fetchpatch {
@@ -246,7 +230,6 @@ stdenv.mkDerivation (
)
) "stackclashprotection"
++ lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs"
++ lib.optional (lib.versionOlder release_version "16") "strictflexarrays3"
++ (finalAttrs.passthru.hardeningUnsupportedFlags or [ ]);
};
@@ -33,7 +33,7 @@ rec {
++ lib.platforms.x86
++ lib.platforms.riscv
++ lib.platforms.m68k
++ lib.optionals (lib.versionAtLeast release_version "16") lib.platforms.loongarch64;
++ lib.platforms.loongarch64;
};
releaseInfo =
@@ -1,32 +0,0 @@
diff -ur a/cmake/builtin-config-ix.cmake b/cmake/builtin-config-ix.cmake
--- a/cmake/builtin-config-ix.cmake @llvm 15.0.6
+++ b/cmake/builtin-config-ix.cmake
@@ -46,7 +46,7 @@
set(ARM64 aarch64)
-set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv8m.main armv8.1m.main)
+set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l armv8m.main armv8.1m.main)
set(AVR avr)
set(HEXAGON hexagon)
set(X86 i386)
set(X86_64 x86_64)
diff -ur a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt
--- a/lib/builtins/CMakeLists.txt @llvm 15.0.6
+++ b/lib/builtins/CMakeLists.txt
@@ -565,6 +565,7 @@
set(armv7_SOURCES ${arm_SOURCES})
set(armv7s_SOURCES ${arm_SOURCES})
set(armv7k_SOURCES ${arm_SOURCES})
+set(armv7l_SOURCES ${arm_SOURCES})
set(arm64_SOURCES ${aarch64_SOURCES})
# macho_embedded archs
@@ -734,7 +735,7 @@
foreach (arch ${BUILTIN_SUPPORTED_ARCH})
if (CAN_TARGET_${arch})
# For ARM archs, exclude any VFP builtins if VFP is not supported
- if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em|armv8m.main|armv8.1m.main)$")
+ if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em|armv8m.main|armv8.1m.main)$")
string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}")
check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP)
if(NOT COMPILER_RT_HAS_${arch}_VFP)
@@ -41,10 +41,7 @@ let
# TODO: Make this account for GCC having libstdcxx, which will help
# use clean up the `cmakeFlags` rats nest below.
haveLibcxx = stdenv.cc.libcxx != null;
isDarwinStatic =
stdenv.hostPlatform.isDarwin
&& stdenv.hostPlatform.isStatic
&& lib.versionAtLeast release_version "16";
isDarwinStatic = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic;
inherit (stdenv.hostPlatform) isMusl isAarch64 isWindows;
noSanitizers = !haveLibc || bareMetal || isMusl || isDarwinStatic || isWindows;
in
@@ -97,10 +94,6 @@ stdenv.mkDerivation (finalAttrs: {
# 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
@@ -191,7 +184,7 @@ stdenv.mkDerivation (finalAttrs: {
(lib.cmakeFeature "COMPILER_RT_OS_DIR" "baremetal")
]
++ lib.optionals (stdenv.hostPlatform.isDarwin) (
lib.optionals (lib.versionAtLeast release_version "16") [
[
(lib.cmakeFeature "CMAKE_LIPO" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}lipo")
]
++ lib.optionals (!haveLibcxx) [
@@ -255,16 +248,12 @@ stdenv.mkDerivation (finalAttrs: {
--replace-fail 'find_program(CODESIGN codesign)' ""
'';
preConfigure =
lib.optionalString (lib.versionOlder release_version "16" && !haveLibc) ''
cmakeFlagsArray+=(-DCMAKE_C_FLAGS="-nodefaultlibs -ffreestanding")
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
cmakeFlagsArray+=(
"-DDARWIN_macosx_CACHED_SYSROOT=$SDKROOT"
"-DDARWIN_macosx_OVERRIDE_SDK_VERSION=$(jq -r .Version "$SDKROOT/SDKSettings.json")"
)
'';
preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
cmakeFlagsArray+=(
"-DDARWIN_macosx_CACHED_SYSROOT=$SDKROOT"
"-DDARWIN_macosx_OVERRIDE_SDK_VERSION=$(jq -r .Version "$SDKROOT/SDKSettings.json")"
)
'';
# Hack around weird upstream RPATH bug
postInstall =
@@ -115,11 +115,7 @@ let
tools:
let
callPackage = newScope (tools // args // metadata);
clangVersion =
if (lib.versionOlder metadata.release_version "16") then
metadata.release_version
else
lib.versions.major metadata.release_version;
clangVersion = lib.versions.major metadata.release_version;
mkExtraBuildCommands0 =
cc:
''
@@ -401,20 +397,16 @@ let
clangNoCompilerRt = tools.clangNoLibcNoRt;
clangNoLibc = tools.clangNoLibcWithBasicRt;
clangNoLibcxx = tools.clangWithLibcAndBasicRt;
}
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "16") {
mlir = callPackage ./mlir { };
}
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "19") {
bolt = callPackage ./bolt {
};
}
//
lib.optionalAttrs
(lib.versionAtLeast metadata.release_version "16" && lib.versionOlder metadata.release_version "22")
{
libclc = callPackage ./libclc { };
}
// lib.optionalAttrs (lib.versionOlder metadata.release_version "22") {
libclc = callPackage ./libclc { };
}
// lib.optionalAttrs (lib.versionAtLeast metadata.release_version "20") {
flang = callPackage ./flang {
mlir = tools.mlir;
@@ -64,8 +64,7 @@ let
# https://github.com/llvm/llvm-project/issues/55245
(lib.cmakeBool "LIBCXX_ENABLE_STATIC_ABI_LIBRARY" stdenv.hostPlatform.isWindows)
]
++ lib.optionals (cxxabi == null && lib.versionAtLeast release_version "16") [
# Note: llvm < 16 doesn't support this flag (or it's broken); handled in postInstall instead.
++ lib.optionals (cxxabi == null) [
# Include libc++abi symbols within libc++.a for static linking libc++;
# dynamic linking includes them through libc++.so being a linker script
# which includes both shared objects.
@@ -96,11 +95,9 @@ let
++ lib.optionals useLLVM [
(lib.cmakeBool "LIBCXX_USE_COMPILER_RT" true)
]
++
lib.optionals (useLLVM && !stdenv.hostPlatform.isFreeBSD && lib.versionAtLeast release_version "16")
[
(lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "unwind")
]
++ lib.optionals (useLLVM && !stdenv.hostPlatform.isFreeBSD) [
(lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "unwind")
]
++ lib.optionals stdenv.hostPlatform.isWasm [
(lib.cmakeBool "LIBCXX_ENABLE_THREADS" false)
(lib.cmakeBool "LIBCXX_ENABLE_FILESYSTEM" false)
@@ -163,37 +160,8 @@ stdenv.mkDerivation (
patchShebangs utils/cat_files.py
'';
patches = lib.optionals (lib.versionOlder release_version "16") (
lib.optional (lib.versions.major release_version == "15")
# See:
# - https://reviews.llvm.org/D133566
# - https://github.com/NixOS/nixpkgs/issues/214524#issuecomment-1429146432
# !!! Drop in LLVM 16+
(
fetchpatch {
url = "https://github.com/llvm/llvm-project/commit/57c7bb3ec89565c68f858d316504668f9d214d59.patch";
hash = "sha256-B07vHmSjy5BhhkGSj3e1E0XmMv5/9+mvC/k70Z29VwY=";
}
)
++ [
(substitute {
src = ../libcxxabi/wasm.patch;
substitutions = [
"--replace-fail"
"/cmake/"
"/llvm/cmake/"
];
})
]
++ lib.optional stdenv.hostPlatform.isMusl (substitute {
src = ./libcxx-0001-musl-hacks.patch;
substitutions = [
"--replace-fail"
"/include/"
"/libcxx/include/"
];
})
);
# TODO: Remove on `staging`.
patches = [ ];
nativeBuildInputs = [
cmake
@@ -219,13 +187,13 @@ stdenv.mkDerivation (
lndir ${lib.getLib cxxabi}/lib $out/lib
libcxxabi=$out/lib/lib${cxxabi.libName}.a
''
# LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON doesn't work for LLVM < 16 or
# LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON doesn't work for
# external cxxabi libraries so merge libc++abi.a into libc++.a ourselves.
# GNU binutils emits objects in LIFO order in MRI scripts so after the merge
# the objects are in reversed order so a second MRI script is required so the
# objects in the archive are listed in proper order (libc++.a, libc++abi.a)
+ lib.optionalString (cxxabi != null || lib.versionOlder release_version "16") ''
+ lib.optionalString (cxxabi != null) ''
libcxxabi=''${libcxxabi-$out/lib/libc++abi.a}
if [[ -f $out/lib/libc++.a && -e $libcxxabi ]]; then
$AR -M <<MRI
@@ -264,7 +232,7 @@ stdenv.mkDerivation (
};
}
// (
if (lib.versionOlder release_version "16" || lib.versionAtLeast release_version "17") then
if lib.versionAtLeast release_version "17" then
{
postPatch = ''
cd runtimes
@@ -1,39 +0,0 @@
From 1c936d7fda3275265e37f93697232a1ed652390f Mon Sep 17 00:00:00 2001
From: Will Dietz <w@wdtz.org>
Date: Sat, 9 Jul 2016 19:22:54 -0500
Subject: [PATCH] musl fixes/hacks
Conflicts:
include/__config
include/locale
src/locale.cpp
---
include/locale | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/locale b/include/locale
index 3d804e8..9b01f5b 100644
--- a/include/locale
+++ b/include/locale
@@ -695,7 +695,7 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
typename remove_reference<decltype(errno)>::type __save_errno = errno;
errno = 0;
char *__p2;
- long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
+ long long __ll = strtoll(__a, &__p2, __base);
typename remove_reference<decltype(errno)>::type __current_errno = errno;
if (__current_errno == 0)
errno = __save_errno;
@@ -735,7 +735,7 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
typename remove_reference<decltype(errno)>::type __save_errno = errno;
errno = 0;
char *__p2;
- unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
+ unsigned long long __ll = strtoull(__a, &__p2, __base);
typename remove_reference<decltype(errno)>::type __current_errno = errno;
if (__current_errno == 0)
errno = __save_errno;
--
1.7.1
@@ -1,16 +0,0 @@
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index 15497d405e0..33f7f18193a 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -127,7 +127,10 @@ else(WIN32)
set(LLVM_HAVE_LINK_VERSION_SCRIPT 1)
endif()
else(FUCHSIA OR UNIX)
- MESSAGE(SEND_ERROR "Unable to determine platform")
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Wasi")
+ else()
+ MESSAGE(SEND_ERROR "Unable to determine platform")
+ endif()
endif(FUCHSIA OR UNIX)
endif(WIN32)
@@ -38,9 +38,7 @@ stdenv.mkDerivation (finalAttrs: {
patches = [
(getVersionFile "lld/gnu-install-dirs.patch")
]
++ lib.optional (lib.versionAtLeast release_version "16" && lib.versionOlder release_version "18") (
getVersionFile "lld/add-table-base.patch"
)
++ lib.optional (lib.versionOlder release_version "18") (getVersionFile "lld/add-table-base.patch")
++ lib.optional (lib.versions.major release_version == "18") (
# https://github.com/llvm/llvm-project/pull/97122
fetchpatch {
@@ -78,23 +78,7 @@ stdenv.mkDerivation (
}).overrideAttrs
(_: _: { name = "resource-dir.patch"; });
in
lib.optionals (lib.versionOlder release_version "16") [
# Fixes for SWIG 4
(fetchpatch2 {
url = "https://github.com/llvm/llvm-project/commit/ba35c27ec9aa9807f5b4be2a0c33ca9b045accc7.patch?full_index=1";
stripLen = 1;
hash = "sha256-LXl+WbpmWZww5xMDrle3BM2Tw56v8k9LO1f1Z1/wDTs=";
})
(fetchpatch2 {
url = "https://github.com/llvm/llvm-project/commit/9ec115978ea2bdfc60800cd3c21264341cdc8b0a.patch?full_index=1";
stripLen = 1;
hash = "sha256-u0zSejEjfrH3ZoMFm1j+NVv2t5AP9cE5yhsrdTS1dG4=";
})
# FIXME: do we need this after 15?
(getVersionFile "lldb/procfs.patch")
]
++ lib.optional (lib.versionOlder release_version "18") (fetchpatch {
lib.optional (lib.versionOlder release_version "18") (fetchpatch {
name = "libcxx-19-char_traits.patch";
url = "https://github.com/llvm/llvm-project/commit/68744ffbdd7daac41da274eef9ac0d191e11c16d.patch";
stripLen = 1;
@@ -140,8 +124,6 @@ stdenv.mkDerivation (
libedit
libxml2
libllvm
]
++ lib.optionals (lib.versionAtLeast release_version "16") [
# Starting with LLVM 16, the resource dir patch is no longer enough to get
# libclang into the rpath of the lldb executables. By putting it into
# buildInputs cc-wrapper will set up rpath correctly for us.
@@ -178,16 +178,6 @@ stdenv.mkDerivation (
stripLen = 1;
}
)
++ lib.optionals (lib.versionOlder release_version "16") [
# Fix musl build.
(fetchpatch {
url = "https://github.com/llvm/llvm-project/commit/5cd554303ead0f8891eee3cd6d25cb07f5a7bf67.patch";
relative = "llvm";
hash = "sha256-XPbvNJ45SzjMGlNUgt/IgEvM2dHQpDOe6woUJY+nUYA=";
})
# Fix for Python 3.13
(getVersionFile "llvm/no-pipes.patch")
]
++ lib.optionals (lib.versionOlder (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
@@ -308,18 +298,10 @@ stdenv.mkDerivation (
+
# 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"}"
''
)
''
substituteInPlace unittests/TargetParser/Host.cpp \
--replace-fail '/usr/bin/sw_vers' "${(builtins.toString darwin.DarwinTools) + "/bin/sw_vers"}"
''
+
# This test tries to call the intrinsics `@llvm.roundeven.f32` and
# `@llvm.roundeven.f64` which seem to (incorrectly?) lower to `roundevenf`
@@ -331,7 +313,7 @@ stdenv.mkDerivation (
#
# 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)" ""
@@ -346,67 +328,52 @@ stdenv.mkDerivation (
+
# dup of above patch with different conditions
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
''
substituteInPlace unittests/TargetParser/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
@@ -422,17 +389,13 @@ stdenv.mkDerivation (
+
# Fails in the presence of anti-virus software or other intrusion-detection software that
# modifies the atime when run. See #284056.
lib.optionalString (lib.versionAtLeast release_version "16") (
''
rm test/tools/llvm-objcopy/ELF/strip-preserve-atime.test
''
+ lib.optionalString (lib.versionOlder release_version "17") ''
''
)
''
rm test/tools/llvm-objcopy/ELF/strip-preserve-atime.test
''
+
# timing-based tests are trouble
lib.optionalString (lib.versionOlder release_version "17") ''
rm utils/lit/tests/googletest-timeout.py
''
+
@@ -12,7 +12,7 @@
}
{
before = "17";
path = ../15;
path = ../16;
}
];
"clang/aarch64-tblgen.patch" = [
@@ -24,7 +24,6 @@
];
"lld/add-table-base.patch" = [
{
after = "16";
path = ../16;
}
];
@@ -67,13 +66,13 @@
}
{
before = "18";
path = ../15;
path = ../16;
}
];
"llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch" = [
{
before = "17";
path = ../15;
path = ../16;
}
{
after = "17";
@@ -86,25 +85,24 @@
path = ../18;
}
{
after = "16";
before = "18";
path = ../16;
}
];
"llvm/polly-lit-cfg-add-libs-to-dylib-path.patch" = [
{
path = ../15;
path = ../16;
}
];
"libunwind/gnu-install-dirs.patch" = [
{
before = "17";
path = ../15;
path = ../16;
}
];
"compiler-rt/X86-support-extension.patch" = [
{
path = ../15;
path = ../16;
}
];
"compiler-rt/armv6-scudo-libatomic.patch" = [
@@ -114,50 +112,27 @@
}
{
before = "19";
path = ../15;
path = ../16;
}
];
"compiler-rt/gnu-install-dirs.patch" = [
{
before = "17";
path = ../15;
path = ../16;
}
{
after = "16";
path = ../17;
}
];
"compiler-rt/darwin-targetconditionals.patch" = [
{
path = ../15;
path = ../16;
}
];
"compiler-rt/normalize-var.patch" = [
{
after = "16";
path = ../16;
}
{
before = "16";
path = ../15;
}
];
"lldb/procfs.patch" = [
{
path = ../15;
}
];
"lldb/resource-dir.patch" = [
{
before = "16";
path = ../15;
}
];
"llvm/no-pipes.patch" = [
{
before = "16";
path = ../15;
}
];
"openmp/fix-find-tool.patch" = [
{
@@ -168,13 +143,8 @@
];
"openmp/run-lit-directly.patch" = [
{
after = "16";
path = ../16;
}
{
before = "16";
path = ../15;
}
];
"libclc/use-default-paths.patch" = [
{
@@ -189,7 +159,6 @@
];
"libclc/gnu-install-dirs.patch" = [
{
after = "16";
before = "21";
path = ../16;
}
@@ -55,8 +55,6 @@ let
"clang-tblgen"
"llvm-tblgen"
"clang-tidy-confusable-chars-gen"
]
++ lib.optionals (lib.versionAtLeast release_version "16") [
"mlir-tblgen"
]
++ lib.optionals (lib.versionOlder release_version "20") [
@@ -95,16 +93,12 @@ let
cmakeFlags = [
# Projects with tablegen-like tools.
"-DLLVM_ENABLE_PROJECTS=${
lib.concatStringsSep ";" (
[
"llvm"
"clang"
"clang-tools-extra"
]
++ lib.optionals (lib.versionAtLeast release_version "16") [
"mlir"
]
)
lib.concatStringsSep ";" [
"llvm"
"clang"
"clang-tools-extra"
"mlir"
]
}"
]
++ devExtraCmakeFlags;
@@ -22,7 +22,6 @@
}@packageSetArgs:
let
versions = {
"15.0.7".officialRelease.sha256 = "sha256-wjuZQyXQ/jsmvy6y1aksCcEDXGBjuhpgngF3XQJ/T4s=";
"16.0.6".officialRelease.sha256 = "sha256-fspqSReX+VD+Nl/Cfq+tDcdPtnQPV1IRopNDfd5VtUs=";
"17.0.6".officialRelease.sha256 = "sha256-8MEDLLhocshmxoEBRSKlJ/GzJ8nfuzQ8qn0X/vLA+ag=";
"18.1.8".officialRelease.sha256 = "sha256-iiZKMRo/WxJaBXct9GdAcAT3cz9d9pnAcO1mmR6oPNE=";
+1
View File
@@ -19,6 +19,7 @@ with pkgs;
(filter (n: n != "llvmPackages_12"))
(filter (n: n != "llvmPackages_13"))
(filter (n: n != "llvmPackages_14"))
(filter (n: n != "llvmPackages_15"))
];
tests = lib.genAttrs pkgSets (
name:
+8 -2
View File
@@ -698,13 +698,11 @@ 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.
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_15 = llvmPackages_15.clang-tools; # Added 2024-04-22
clang-tools_16 = llvmPackages_16.clang-tools; # Added 2024-04-22
clang-tools_17 = llvmPackages_17.clang-tools; # Added 2024-04-22
clang-tools_18 = llvmPackages_18.clang-tools; # Added 2024-04-22
@@ -1507,6 +1505,14 @@ mapAliases {
clang14Stdenv = throw "clang14Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
clang-tools_14 = throw "clang-tools_14 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-10
llvmPackages_15 = throw "llvmPackages_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
llvm_15 = throw "llvm_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
lld_15 = throw "lld_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
lldb_15 = throw "lldb_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
clang_15 = throw "clang_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
clang15Stdenv = throw "clang15Stdenv has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
clang-tools_15 = throw "clang-tools_15 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-12
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_15 = llvmPackages_15.clang;
clang_16 = llvmPackages_16.clang;
clang_17 = llvmPackages_17.clang;
@@ -5362,17 +5361,14 @@ with pkgs;
};
lld = llvmPackages.lld;
lld_15 = llvmPackages_15.lld;
lld_16 = llvmPackages_16.lld;
lld_17 = llvmPackages_17.lld;
lldb = llvmPackages.lldb;
lldb_15 = llvmPackages_15.lldb;
lldb_16 = llvmPackages_16.lldb;
lldb_17 = llvmPackages_17.lldb;
llvm = llvmPackages.llvm;
llvm_15 = llvmPackages_15.llvm;
llvm_16 = llvmPackages_16.llvm;
llvm_17 = llvmPackages_17.llvm;
@@ -5390,7 +5386,6 @@ with pkgs;
(rec {
llvmPackagesSet = recurseIntoAttrs (callPackages ../development/compilers/llvm { });
llvmPackages_15 = llvmPackagesSet."15";
llvmPackages_16 = llvmPackagesSet."16";
llvmPackages_17 = llvmPackagesSet."17";
@@ -5425,7 +5420,6 @@ with pkgs;
mkLLVMPackages = llvmPackagesSet.mkPackage;
})
llvmPackages_15
llvmPackages_16
llvmPackages_17
llvmPackages_18