summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm/15/default.nix
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-05-06 21:03:17 +0300
committerArtturin <Artturin@artturin.com>2023-05-09 19:59:45 +0300
commitd53d5a8b38f8ecbf75388a1582efd4c19e61d5da (patch)
tree0857d413f23be8659951be48dee9dadfa7658acc /pkgs/development/compilers/llvm/15/default.nix
parent0ef7eafdb1cc834ecdcb2b9065413f79bb0145e1 (diff)
downloadnixpkgs-d53d5a8b38f8ecbf75388a1582efd4c19e61d5da.tar
nixpkgs-d53d5a8b38f8ecbf75388a1582efd4c19e61d5da.tar.gz
nixpkgs-d53d5a8b38f8ecbf75388a1582efd4c19e61d5da.tar.bz2
nixpkgs-d53d5a8b38f8ecbf75388a1582efd4c19e61d5da.tar.lz
nixpkgs-d53d5a8b38f8ecbf75388a1582efd4c19e61d5da.tar.xz
nixpkgs-d53d5a8b38f8ecbf75388a1582efd4c19e61d5da.tar.zst
nixpkgs-d53d5a8b38f8ecbf75388a1582efd4c19e61d5da.zip
llvmPackages.lldb: deduplicate >10
Diffstat (limited to 'pkgs/development/compilers/llvm/15/default.nix')
-rw-r--r--pkgs/development/compilers/llvm/15/default.nix35
1 files changed, 30 insertions, 5 deletions
diff --git a/pkgs/development/compilers/llvm/15/default.nix b/pkgs/development/compilers/llvm/15/default.nix
index d4fd2d9bec6..931fb9a6cce 100644
--- a/pkgs/development/compilers/llvm/15/default.nix
+++ b/pkgs/development/compilers/llvm/15/default.nix
@@ -183,11 +183,36 @@ in let
       inherit llvm_meta;
     };
 
-    lldb = callPackage ./lldb {
-      inherit llvm_meta;
-      inherit (darwin) libobjc bootstrap_cmds;
-      inherit (darwin.apple_sdk.libs) xpc;
-      inherit (darwin.apple_sdk.frameworks) Foundation Carbon Cocoa;
+    lldb = callPackage ../common/lldb.nix {
+      patches =
+        let
+          resourceDirPatch = callPackage ({ runCommand, libclang }: (runCommand "resource-dir.patch"
+            {
+              clangLibDir = "${libclang.lib}/lib";
+            } ''
+            substitute '${./lldb/resource-dir.patch}' "$out" --subst-var clangLibDir
+          '')) { };
+        in
+        [
+          ./lldb/procfs.patch
+          resourceDirPatch
+          ./lldb/gnu-install-dirs.patch
+        ]
+        # This is a stopgap solution if/until the macOS SDK used for x86_64 is
+        # updated.
+        #
+        # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h`
+        # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use
+        # of this preprocessor symbol in `lldb` with its expansion.
+        #
+        # See here for some context:
+        # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
+        ++ lib.optional (
+          stdenv.targetPlatform.isDarwin
+            && !stdenv.targetPlatform.isAarch64
+            && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
+        ) ./lldb/cpu_subtype_arm64e_replacement.patch;
+      inherit llvm_meta release_version;
     };
 
     # Below, is the LLVM bootstrapping logic. It handles building a