mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
llvmPackages_git: 23.0.0-unstable-2026-05-24 -> 23.0.0-unstable-2026-05-31
This commit is contained in:
parent
5ce911fd03
commit
0917fee1c3
4 changed files with 159 additions and 12 deletions
137
pkgs/development/compilers/llvm/23/llvm/gnu-install-dirs.patch
Normal file
137
pkgs/development/compilers/llvm/23/llvm/gnu-install-dirs.patch
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index a90be4f6235e..be9cef03bfea 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1207,9 +1207,9 @@ 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)
|
||||
install(TARGETS tf_xla_runtime EXPORT LLVMDevelopmentExports
|
||||
- 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 835750e2d2a1..f7400f708535 100644
|
||||
--- a/cmake/modules/AddLLVM.cmake
|
||||
+++ b/cmake/modules/AddLLVM.cmake
|
||||
@@ -974,8 +974,8 @@ macro(add_llvm_library name)
|
||||
endif()
|
||||
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)
|
||||
@@ -2263,7 +2263,7 @@ function(llvm_install_library_symlink name dest type)
|
||||
set(LLVM_LINK_OR_COPY copy)
|
||||
endif()
|
||||
|
||||
- set(output_dir lib${LLVM_LIBDIR_SUFFIX})
|
||||
+ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
|
||||
if((WIN32 OR CYGWIN) AND "${type}" STREQUAL "SHARED")
|
||||
set(output_dir "${CMAKE_INSTALL_BINDIR}")
|
||||
endif()
|
||||
@@ -2539,14 +2539,35 @@ 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 ${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_PREFIX}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
|
||||
elseif(UNIX)
|
||||
+ # Note that we add `extra_libdir` (aka `LLVM_LIBRARY_DIR` in our case) back
|
||||
+ # to `_install_rpath` here.
|
||||
+ #
|
||||
+ # In nixpkgs we do not build and install LLVM alongside rdeps of LLVM (i.e.
|
||||
+ # clang); instead LLVM is its own package and thus lands at its own nix
|
||||
+ # store path. This makes it so that the default relative rpath (`../lib/`)
|
||||
+ # does not point at the LLVM shared objects.
|
||||
+ #
|
||||
+ # More discussion here:
|
||||
+ # - https://github.com/NixOS/nixpkgs/pull/235624#discussion_r1220150329
|
||||
+ # - https://reviews.llvm.org/D146918 (16.0.5+)
|
||||
+ #
|
||||
+ # Note that we leave `extra_libdir` in `_build_rpath`: without FHS there is
|
||||
+ # no potential that this will result in us pulling in the "wrong" LLVM.
|
||||
+ # Adding this to the build rpath means we aren't forced to use
|
||||
+ # `installCheckPhase` instead of `checkPhase` (i.e. binaries in the build
|
||||
+ # dir, pre-install, will have the right rpath for LLVM).
|
||||
+ #
|
||||
+ # As noted in the differential above, an alternative solution is to have
|
||||
+ # all rdeps of nixpkgs' LLVM (that use the AddLLVM.cmake machinery) set
|
||||
+ # `CMAKE_INSTALL_RPATH`.
|
||||
set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
|
||||
- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
|
||||
+ set(_install_rpath ${extra_libdir})
|
||||
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
|
||||
diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
|
||||
index 2d9116b08a52..2dd7cad4ec66 100644
|
||||
--- a/cmake/modules/AddOCaml.cmake
|
||||
+++ b/cmake/modules/AddOCaml.cmake
|
||||
@@ -147,9 +147,9 @@ function(add_ocaml_library name)
|
||||
endforeach()
|
||||
|
||||
if( APPLE )
|
||||
- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}")
|
||||
+ set(ocaml_rpath ${LLVM_LIBRARY_DIR})
|
||||
elseif( UNIX )
|
||||
- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}")
|
||||
+ set(ocaml_rpath ${LLVM_LIBRARY_DIR})
|
||||
endif()
|
||||
list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}")
|
||||
|
||||
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
|
||||
index ef4cfa3acdb5..7478e157a7c2 100644
|
||||
--- a/cmake/modules/CMakeLists.txt
|
||||
+++ b/cmake/modules/CMakeLists.txt
|
||||
@@ -130,7 +130,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS
|
||||
)
|
||||
list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS)
|
||||
|
||||
-extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}")
|
||||
+extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}")
|
||||
set(LLVM_CONFIG_LIBRARY_DIRS
|
||||
"${LLVM_CONFIG_LIBRARY_DIR}"
|
||||
# FIXME: Should there be other entries here?
|
||||
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
|
||||
index e4e1d449bf4d..3aab6ea7bf8b 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 49df8fdcb7f7..c7cb05b82821 100644
|
||||
--- a/tools/llvm-config/llvm-config.cpp
|
||||
+++ b/tools/llvm-config/llvm-config.cpp
|
||||
@@ -365,7 +365,11 @@ int main(int argc, char **argv) {
|
||||
sys::fs::make_absolute(ActivePrefix, Path);
|
||||
ActiveBinDir = std::string(Path);
|
||||
}
|
||||
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
|
||||
+ {
|
||||
+ SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX);
|
||||
+ sys::path::make_absolute(ActivePrefix, Path);
|
||||
+ ActiveLibDir = std::string(Path);
|
||||
+ }
|
||||
{
|
||||
SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR);
|
||||
sys::fs::make_absolute(ActivePrefix, Path);
|
||||
|
|
@ -21,8 +21,13 @@
|
|||
}
|
||||
];
|
||||
"llvm/gnu-install-dirs.patch" = [
|
||||
{
|
||||
after = "23";
|
||||
path = ../23;
|
||||
}
|
||||
{
|
||||
after = "22";
|
||||
before = "23";
|
||||
path = ../22;
|
||||
}
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,15 +38,20 @@ let
|
|||
|
||||
src' =
|
||||
if monorepoSrc != null then
|
||||
runCommand "${pname}-src-${version}" { } ''
|
||||
mkdir -p "$out"
|
||||
cp -r ${monorepoSrc}/cmake "$out"
|
||||
cp -r ${monorepoSrc}/third-party "$out"
|
||||
cp -r ${monorepoSrc}/llvm "$out"
|
||||
cp -r ${monorepoSrc}/clang "$out"
|
||||
cp -r ${monorepoSrc}/clang-tools-extra "$out"
|
||||
cp -r ${monorepoSrc}/mlir "$out"
|
||||
''
|
||||
runCommand "${pname}-src-${version}" { } (
|
||||
''
|
||||
mkdir -p "$out"
|
||||
cp -r ${monorepoSrc}/cmake "$out"
|
||||
cp -r ${monorepoSrc}/third-party "$out"
|
||||
cp -r ${monorepoSrc}/llvm "$out"
|
||||
cp -r ${monorepoSrc}/clang "$out"
|
||||
cp -r ${monorepoSrc}/clang-tools-extra "$out"
|
||||
cp -r ${monorepoSrc}/mlir "$out"
|
||||
''
|
||||
+ lib.optionalString (lib.versionAtLeast version "23") ''
|
||||
cp -r ${monorepoSrc}/libc "$out"
|
||||
''
|
||||
)
|
||||
else
|
||||
src;
|
||||
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ let
|
|||
"21.1.8".officialRelease.sha256 = "sha256-pgd8g9Yfvp7abjCCKSmIn1smAROjqtfZaJkaUkBSKW0=";
|
||||
"22.1.6".officialRelease.sha256 = "sha256-0on6nTlwzVTT0y3tjZ4ijt5qPQfY/o9Uwe2VYq2NZx8=";
|
||||
"23.0.0-git".gitRelease = {
|
||||
rev = "25294a2fffcf40cbd8b6743d78524badeded7446";
|
||||
rev-version = "23.0.0-unstable-2026-05-24";
|
||||
sha256 = "sha256-TEb4GetdllWC67ulgi7L8CB55YzR1xCWZOMQ+nENdTw=";
|
||||
rev = "0ecf562dac85a29f3de1dd598e3ae0ecc34d1240";
|
||||
rev-version = "23.0.0-unstable-2026-05-31";
|
||||
sha256 = "sha256-9F/X7c3i+eyMhutmG5qvaoWaikOTBI20njDwn5TWCOU=";
|
||||
};
|
||||
}
|
||||
// llvmVersions;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue