diff --git a/pkgs/development/compilers/llvm/22/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/22/clang/gnu-install-dirs.patch new file mode 100644 index 000000000000..d86f269c7ab8 --- /dev/null +++ b/pkgs/development/compilers/llvm/22/clang/gnu-install-dirs.patch @@ -0,0 +1,71 @@ +diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake +index 4059fc3e986c..e7b414d4c767 100644 +--- a/cmake/modules/AddClang.cmake ++++ b/cmake/modules/AddClang.cmake +@@ -134,8 +134,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 1b96ac417bf7..cf5b590fbc1b 100644 +--- a/lib/Headers/CMakeLists.txt ++++ b/lib/Headers/CMakeLists.txt +@@ -402,6 +402,7 @@ set(zos_wrapper_files + + include(GetClangResourceDir) + get_clang_resource_dir(output_dir PREFIX ${LLVM_LIBRARY_OUTPUT_INTDIR}/.. SUBDIR include) ++set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION_MAJOR}/include) + set(out_files) + set(generated_files) + +diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt +index b0105f5a5f79..c8298517b3d2 100644 +--- a/tools/libclang/CMakeLists.txt ++++ b/tools/libclang/CMakeLists.txt +@@ -244,7 +244,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 84087a9fd8d2..ecf377349cb5 100644 +--- a/tools/scan-build-py/CMakeLists.txt ++++ b/tools/scan-build-py/CMakeLists.txt +@@ -91,7 +91,7 @@ if(CLANG_INSTALL_SCANBUILDPY) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}) + install(FILES lib/libscanbuild/${lib} +- DESTINATION lib/libscanbuild ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild" + COMPONENT scan-build-py) + endforeach() + +@@ -109,7 +109,7 @@ if(CLANG_INSTALL_SCANBUILDPY) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}) + install(FILES lib/libscanbuild/resources/${resource} +- DESTINATION lib/libscanbuild/resources ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild/resources" + COMPONENT scan-build-py) + endforeach() + +@@ -125,7 +125,7 @@ if(CLANG_INSTALL_SCANBUILDPY) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib}) + install(FILES lib/libear/${lib} +- DESTINATION lib/libear ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/libear" + COMPONENT scan-build-py) + endforeach() + diff --git a/pkgs/development/compilers/llvm/22/llvm/lit-shell-script-runner-set-dyld-library-path.patch b/pkgs/development/compilers/llvm/22/llvm/lit-shell-script-runner-set-dyld-library-path.patch new file mode 100644 index 000000000000..87f7aa9c8452 --- /dev/null +++ b/pkgs/development/compilers/llvm/22/llvm/lit-shell-script-runner-set-dyld-library-path.patch @@ -0,0 +1,14 @@ +diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py +index 7a233b238f7e..23aa87fdb097 100644 +--- a/utils/lit/lit/TestRunner.py ++++ b/utils/lit/lit/TestRunner.py +@@ -1341,6 +1341,9 @@ def executeScript(test, litConfig, tmpBase, commands, cwd): + f.write("@echo on\n") + f.write("\n@if %ERRORLEVEL% NEQ 0 EXIT\n".join(commands)) + else: ++ 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.fullmatch(kPdbgRegex, ln) + if match: diff --git a/pkgs/development/compilers/llvm/common/patches.nix b/pkgs/development/compilers/llvm/common/patches.nix index b97f8af6eae2..757eaf7230e5 100644 --- a/pkgs/development/compilers/llvm/common/patches.nix +++ b/pkgs/development/compilers/llvm/common/patches.nix @@ -1,7 +1,12 @@ { "clang/gnu-install-dirs.patch" = [ + { + after = "22"; + path = ../22; + } { after = "19"; + before = "22"; path = ../19; } ]; @@ -51,8 +56,13 @@ } ]; "llvm/lit-shell-script-runner-set-dyld-library-path.patch" = [ + { + after = "22"; + path = ../22; + } { path = ../18; + before = "22"; } ]; "llvm/polly-lit-cfg-add-libs-to-dylib-path.patch" = [ diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix index 0fee751cc771..90f237dbc1db 100644 --- a/pkgs/development/compilers/llvm/default.nix +++ b/pkgs/development/compilers/llvm/default.nix @@ -27,9 +27,9 @@ let "20.1.8".officialRelease.sha256 = "sha256-ysyB/EYxi2qE9fD5x/F2zI4vjn8UDoo1Z9ukiIrjFGw="; "21.1.2".officialRelease.sha256 = "sha256-SgZdBL0ivfv6/4EqmPQ+I57qT2t6i/rqnm20+T1BsFY="; "22.0.0-git".gitRelease = { - rev = "8f51da369e6e7f13bea941e61b4b2c5fa81216f5"; - rev-version = "22.0.0-unstable-2025-12-14"; - sha256 = "sha256-9om/PWp+cjMRP+2LVhC1xCczmabNenebEMDbOytyhUA="; + rev = "185f5fd5ce4c65116ca8cf6df467a682ef090499"; + rev-version = "22.0.0-unstable-2025-12-21"; + sha256 = "sha256-NcDH3JspWmq6B3wFy4wkbAzdpsKJojrJpQyAIm7qFdQ="; }; } // llvmVersions;