llvmPackages_9.lldb: fix darwin build

Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>

+39 -1
+22 -1
pkgs/development/compilers/llvm/9/lldb/default.nix
··· 1 1 { lib, stdenv, llvm_meta 2 2 , fetch 3 + , fetchpatch 3 4 , cmake 4 5 , zlib 5 6 , ncurses ··· 13 14 , version 14 15 , darwin 15 16 , makeWrapper 17 + , perl 16 18 , lit 17 19 }: 18 20 ··· 25 27 patches = [ 26 28 ./procfs.patch 27 29 ./gnu-install-dirs.patch 30 + 31 + # Fix darwin build 32 + (fetchpatch { 33 + name = "lldb-use-system-debugserver-fix.patch"; 34 + url = "https://github.com/llvm-mirror/lldb/commit/be770754cc43da22eacdb70c6203f4582eeb011f.diff"; 35 + sha256 = "sha256-tKkk6sn//0Hu0nlzoKWs5fXMWc+O2JAWOEJ1ZnaLuVU="; 36 + excludes = [ "packages/*" ]; 37 + postFetch = '' 38 + substituteInPlace "$out" --replace add_lldb_tool_subdirectory add_subdirectory 39 + ''; 40 + }) 41 + ./lldb-gdb-remote-no-libcompress.patch 28 42 ]; 29 43 30 44 outputs = [ "out" "lib" "dev" ]; 31 45 32 46 nativeBuildInputs = [ 33 47 cmake python3 which swig lit makeWrapper 48 + ] ++ lib.optionals stdenv.isDarwin [ 49 + # for scripts/generate-vers.pl 50 + perl 34 51 ]; 35 52 36 53 buildInputs = [ ··· 42 59 darwin.bootstrap_cmds 43 60 darwin.apple_sdk.frameworks.Carbon 44 61 darwin.apple_sdk.frameworks.Cocoa 62 + darwin.apple_sdk.frameworks.DebugSymbols 45 63 ]; 46 64 47 65 CXXFLAGS = "-fno-rtti"; ··· 52 70 "-DClang_DIR=${libclang.dev}/lib/cmake" 53 71 "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" 54 72 "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 73 + ] ++ lib.optionals stdenv.isDarwin [ 74 + # Building debugserver requires the proprietary libcompression 75 + "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" 55 76 ] ++ lib.optionals doCheck [ 56 77 "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 57 78 "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" ··· 80 101 ''; 81 102 82 103 meta = llvm_meta // { 83 - broken = stdenv.isDarwin; 104 + broken = stdenv.isDarwin && stdenv.isAarch64; 84 105 homepage = "https://lldb.llvm.org/"; 85 106 description = "A next-generation high-performance debugger"; 86 107 longDescription = ''
+17
pkgs/development/compilers/llvm/9/lldb/lldb-gdb-remote-no-libcompress.patch
··· 1 + diff -ru a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 2 + --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 2019-12-11 14:15:30.000000000 -0500 3 + +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 2021-11-26 23:44:28.000000000 -0500 4 + @@ -36,13 +36,6 @@ 5 + 6 + #include "llvm/ADT/StringSwitch.h" 7 + 8 + -#if defined(__APPLE__) 9 + -#ifndef HAVE_LIBCOMPRESSION 10 + -#define HAVE_LIBCOMPRESSION 11 + -#endif 12 + -#include <compression.h> 13 + -#endif 14 + - 15 + using namespace lldb; 16 + using namespace lldb_private; 17 + using namespace lldb_private::process_gdb_remote;