From b2175bf914fdabfa1f0bd3ee8992da9586e7f7cc Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Sun, 25 Oct 2026 14:58:20 -0700 Subject: [PATCH] llvmPackages_git: 24.0.0-unstable-2026-10-18 -> 24.0.0-unstable-2026-10-25 (cherry picked from commit ad90f2ed7eea21fb2855ec4302710b5ad939f45f) --- .../llvm-lit-cfg-add-libs-to-dylib-path.patch | 89 +++++++++++++++++++ .../compilers/llvm/common/patches.nix | 5 ++ pkgs/development/compilers/llvm/default.nix | 6 +- 3 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/compilers/llvm/24/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch diff --git a/pkgs/development/compilers/llvm/24/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch b/pkgs/development/compilers/llvm/24/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch new file mode 100644 index 000000000000..0b46f680c5ab --- /dev/null +++ b/pkgs/development/compilers/llvm/24/llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch @@ -0,0 +1,89 @@ +diff --git a/test/Unit/lit.cfg.py b/test/Unit/lit.cfg.py +index e426e0e..303f7cf 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 +@@ -64,6 +65,31 @@ if sys.platform in ["win32", "cygwin"] and os.path.isdir(config.shlibdir): + 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()) ++ ) ++ + # The unit tests on z/OS need auto-conversion turned on. + if sys.platform == "zos": + config.environment["_BPXK_AUTOCVT"] = "ON" +diff --git a/test/lit.cfg.py b/test/lit.cfg.py +index a320ddc..7d24e5e 100644 +--- a/test/lit.cfg.py ++++ b/test/lit.cfg.py +@@ -101,6 +101,29 @@ llvm_config.with_environment("PATH", config.llvm_tools_dir, append_path=True) + # Propagate some variables from the host environment. + 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") +@@ -609,7 +632,9 @@ 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") diff --git a/pkgs/development/compilers/llvm/common/patches.nix b/pkgs/development/compilers/llvm/common/patches.nix index a2ecc75785c9..cf5ebcfe7b4a 100644 --- a/pkgs/development/compilers/llvm/common/patches.nix +++ b/pkgs/development/compilers/llvm/common/patches.nix @@ -79,6 +79,11 @@ ]; "llvm/llvm-lit-cfg-add-libs-to-dylib-path.patch" = [ { + after = "24"; + path = ../24; + } + { + before = "24"; path = ../18; } ]; diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix index cdc2b926f49c..220fc1c1af55 100644 --- a/pkgs/development/compilers/llvm/default.nix +++ b/pkgs/development/compilers/llvm/default.nix @@ -29,9 +29,9 @@ let "22.1.8".officialRelease.sha256 = "sha256-SF7wFuh4kXZTytpdgX7vUZItKtRobnVICm+ixze4iG0="; "23.1.0".officialRelease.sha256 = "sha256-Astfi1UDDcydyws3Q1sELqho/PxiNN/tvCtmCGj5FoE="; "24.0.0-git".gitRelease = { - rev = "5ca62fdee645ec253263e41a45fe626c6b66be22"; - rev-version = "24.0.0-unstable-2026-10-18"; - sha256 = "sha256-6Y+9oliib4BM3i7eq00c+xFeKG7c4193XcN+bzBinEU="; + rev = "60e80af877a7e9683eeea5e05f332767a76c0321"; + rev-version = "24.0.0-unstable-2026-10-25"; + sha256 = "sha256-xOalhDdwZvWZfscu2uULD+aSMzu5nDC2rQBjzlcVXak="; }; } // llvmVersions;