Skip to content

[Backport staging-26.05] llvmPackages_{18,19,20,21,22}.libllvm: backport Darwin triple parsing; lldb: backport export trie fixes to LLDB 22 and older - #562652

Merged
booxter merged 3 commits into
NixOS:staging-26.05from
booxter:backport-darwin-27-triple-fix
Sep 19, 2026

Conversation

@booxter

@booxter booxter commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes llvm builds on macOS 27. Fixed lldb on macOS 27.

  • llvmPackages_{18,19,20,21,22}.libllvm: backport Darwin triple parsing
  • llvmPackages_{18,19,20}.libllvm: reenable disabled test
  • lldb: backport export trie fixes to LLDB 22 and older

Things done

This fixes breakage on triples for macOS 27, which aligned the Darwin
version with the OS version (darwin26 is macOS 27, but so is darwin27,
which will be incorrectly interpreted as macOS 28 without this patch).
This is probably harmless in most cases, but it causes a test failure in
LLVM’s test suite when running under macOS 27.

(cherry picked from commit 6fb7a4d)
This test works again after the patch in 2694524 is applied.

(cherry picked from commit dca5964)

@nixpkgs-commit-check nixpkgs-commit-check Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This report is automatically generated by the PR / Check / cherry-pick CI workflow.

Some of the commits in this PR require the author's and reviewer's attention.

Sometimes it is not possible to cherry-pick exactly the same patch.
This most frequently happens when resolving merge conflicts.
The range-diff will help to review the resolution of conflicts.

If you need to merge this PR despite the warnings, please dismiss this review shortly before merging.

Warning

Difference between 3692fe6 and original 6fb7a4d may warrant inspection.

Show diff
@@ Commit message
     This is probably harmless in most cases, but it causes a test failure in
     LLVM’s test suite when running under macOS 27.
 
+    (cherry picked from commit 6fb7a4dc0c9ba446ba0968bd046601a2e5903571)
+
  ## pkgs/development/compilers/llvm/18/llvm/backport-darwin-triple-parsing.patch (new) ##
 @@
 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
@@ -1449,9 +1449,12 @@ bool Triple::getMacOSXVersion(VersionTuple &Version) const {
 
  ## pkgs/development/compilers/llvm/common/llvm/default.nix ##
 @@ pkgs/development/compilers/llvm/common/llvm/default.nix: stdenv.mkDerivation (
+               hash = "sha256-3hkbYPUVRAtWpo5qBmc2jLZLivURMx8T0GQomvNZesc=";
                stripLen = 1;
-           hash = "sha256-HHVMVL7ZWiZkbfnD37zYxFWnfvI3LNS0Z2oFHhOaZsU=";
-         })
-+      ]
+             }
+-          );
++          )
 +      ++ lib.optionals (lib.versionOlder release_version "23") [
 +        # As of macOS 27 (and iOS 27, etc), the Darwin version number is the same as the OS version number.
 +        # This change breaks target parsing because `darwin27` is incorrectly interpreted as macOS 28.
 +        # This patch is a backport of the target parsing changes in LLVM 23, which fixes the problem.
 +        # Hopefully, Apple does not change the version number scheme again any time soon.
 +        (getVersionFile "llvm/backport-darwin-triple-parsing.patch")
-       ];
++      ];
  
      nativeBuildInputs = [
+       cmake
 
  ## pkgs/development/compilers/llvm/common/patches.nix ##
 @@

Warning

Difference between 51db35b and original 53b813b may warrant inspection.

Show diff
@@ Commit message
     The fixes from LLVM 23 can’t be cherry-picked due to other changes. They
     have been manually backported and squashed into a single patch.
 
+    (cherry picked from commit 53b813b1660e8ae9f62a5334a7bd89b42c7ea752)
+
  ## pkgs/development/compilers/llvm/18/lldb/backport-ParseTrieEntries-fixes.patch (new) ##
 @@
 +diff --git a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -2659,9 +2682,8 @@
 + 
 
  ## pkgs/development/compilers/llvm/common/lldb/default.nix ##
-@@
-   monorepoSrc ? null,
-   enableManpages ? false,
-   devExtraCmakeFlags ? [ ],
-+  getVersionFile,
-   versionCheckHook,
- }:
- 
 @@ pkgs/development/compilers/llvm/common/lldb/default.nix: stdenv.mkDerivation (
        # Fix build with gcc15
        # https://github.com/llvm/llvm-project/commit/bb59f04e7e75dcbe39f1bf952304a157f0035314

Hint: The full diffs are also available in the runner logs with slightly better highlighting.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 4.workflow: backport This targets a stable branch labels Sep 12, 2026
Older versions of LLDB crash on macOS 27 when starting a debugging
session on macOS 27 due to a stack overflow in `ParseExportTries`.

The fixes from LLVM 23 can’t be cherry-picked due to other changes. They
have been manually backported and squashed into a single patch.

(cherry picked from commit 53b813b)
@booxter booxter changed the title [Backport staging-26.05] llvmPackages_{18,19,20,21,22}.libllvm: backport Darwin triple parsing [Backport staging-26.05] llvmPackages_{18,19,20,21,22}.libllvm: backport Darwin triple parsing; lldb: backport export trie fixes to LLDB 22 and older Sep 12, 2026
@booxter

booxter commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 562652 --package llvmPackages_19.libllvm --package llvmPackages_22.lldb --package llvmPackages_22.libllvm --package llvmPackages_20.libllvm --package llvmPackages_21.libllvm --package llvmPackages_18.libllvm
Commit: 51db35b37cac0f240b6a2add73ebd47f096ff8b8


x86_64-linux

✅ 6 packages built:
  • llvmPackages_18.libllvm
  • llvmPackages_19.libllvm
  • llvmPackages_20.libllvm
  • llvmPackages_21.libllvm
  • llvmPackages_22.libllvm
  • llvmPackages_22.lldb

aarch64-darwin

✅ 6 packages built:
  • llvmPackages_18.libllvm
  • llvmPackages_19.libllvm
  • llvmPackages_20.libllvm
  • llvmPackages_21.libllvm
  • llvmPackages_22.libllvm
  • llvmPackages_22.lldb

@booxter

booxter commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author
>  ./result/bin/lldb /bin/bash
(lldb) target create "/bin/bash"
Current executable set to '/bin/bash' (arm64e).
(lldb)

@booxter
booxter marked this pull request as ready for review September 12, 2026 23:37
@booxter
booxter requested a review from reckenrode September 12, 2026 23:38
@nixpkgs-ci
nixpkgs-ci Bot requested review from a team and pyrox0 and removed request for a team September 12, 2026 23:39
@booxter
booxter added this pull request to the merge queue Sep 19, 2026
Merged via the queue into NixOS:staging-26.05 with commit 581c8e4 Sep 19, 2026
35 checks passed
@booxter
booxter deleted the backport-darwin-27-triple-fix branch September 19, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.workflow: backport This targets a stable branch 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants