about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/llvm/12/lldb
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/llvm/12/lldb')
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/12/lldb/gnu-install-dirs.patch91
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/12/lldb/procfs.patch31
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/12/lldb/resource-dir.patch13
3 files changed, 135 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/compilers/llvm/12/lldb/gnu-install-dirs.patch b/nixpkgs/pkgs/development/compilers/llvm/12/lldb/gnu-install-dirs.patch
new file mode 100644
index 000000000000..afc945ce2614
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/llvm/12/lldb/gnu-install-dirs.patch
@@ -0,0 +1,91 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b5633e21c56a..f2f1035e9238 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -10,6 +10,8 @@ set(CMAKE_MODULE_PATH
+ # If we are not building as part of LLVM, build LLDB as a standalone project,
+ # using LLVM as an external library.
+ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
++  include(GNUInstallDirs)
++
+   project(lldb)
+   include(LLDBStandalone)
+ 
+diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake
+index 4ed5c647c5d2..89f96e710d55 100644
+--- a/cmake/modules/AddLLDB.cmake
++++ b/cmake/modules/AddLLDB.cmake
+@@ -107,13 +107,13 @@ function(add_lldb_library name)
+   endif()
+ 
+   if(PARAM_SHARED)
+-    set(install_dest lib${LLVM_LIBDIR_SUFFIX})
++    set(install_dest ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
+     if(PARAM_INSTALL_PREFIX)
+       set(install_dest ${PARAM_INSTALL_PREFIX})
+     endif()
+     # RUNTIME is relevant for DLL platforms, FRAMEWORK for macOS
+     install(TARGETS ${name} COMPONENT ${name}
+-      RUNTIME DESTINATION bin
++      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+       LIBRARY DESTINATION ${install_dest}
+       ARCHIVE DESTINATION ${install_dest}
+       FRAMEWORK DESTINATION ${install_dest})
+diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake
+index 2fdf1502d055..37364341ff8b 100644
+--- a/cmake/modules/LLDBConfig.cmake
++++ b/cmake/modules/LLDBConfig.cmake
+@@ -225,7 +225,7 @@ include_directories(BEFORE
+ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+   install(DIRECTORY include/
+     COMPONENT lldb-headers
+-    DESTINATION include
++    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+     FILES_MATCHING
+     PATTERN "*.h"
+     PATTERN ".cmake" EXCLUDE
+@@ -233,7 +233,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+ 
+   install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
+     COMPONENT lldb-headers
+-    DESTINATION include
++    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+     FILES_MATCHING
+     PATTERN "*.h"
+     PATTERN ".cmake" EXCLUDE
+diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt
+index 734167e51bc5..f95761b5df58 100644
+--- a/tools/intel-features/CMakeLists.txt
++++ b/tools/intel-features/CMakeLists.txt
+@@ -65,4 +65,4 @@ if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
+ endif()
+ 
+ install(TARGETS lldbIntelFeatures
+-  LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
+diff --git a/cmake/modules/LLDBStandalone.cmake b/cmake/modules/LLDBStandalone.cmake
+index 752113b..010f187 100644
+--- a/cmake/modules/LLDBStandalone.cmake
++++ b/cmake/modules/LLDBStandalone.cmake
+@@ -62,7 +62,7 @@ endif()
+
+ # They are used as destination of target generators.
+ set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
+-set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
++set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
+ if(WIN32 OR CYGWIN)
+   # DLL platform -- put DLLs into bin.
+   set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b5633e2..86e4738 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -79,7 +79,7 @@ if (LLDB_ENABLE_PYTHON)
+   if(LLDB_BUILD_FRAMEWORK)
+     set(lldb_python_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb")
+   else()
+-    set(lldb_python_target_dir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb")
++    set(lldb_python_target_dir "${CMAKE_INSTALL_LIBDIR}/../${LLDB_PYTHON_RELATIVE_PATH}/lldb")
+   endif()
+   get_target_property(lldb_python_bindings_dir swig_wrapper_python BINARY_DIR)
+   finish_swig_python("lldb-python" "${lldb_python_bindings_dir}" "${lldb_python_target_dir}")
diff --git a/nixpkgs/pkgs/development/compilers/llvm/12/lldb/procfs.patch b/nixpkgs/pkgs/development/compilers/llvm/12/lldb/procfs.patch
new file mode 100644
index 000000000000..b075dbaeee0a
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/llvm/12/lldb/procfs.patch
@@ -0,0 +1,31 @@
+--- a/source/Plugins/Process/Linux/Procfs.h
++++ b/source/Plugins/Process/Linux/Procfs.h
+@@ -11,21 +11,12 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
diff --git a/nixpkgs/pkgs/development/compilers/llvm/12/lldb/resource-dir.patch b/nixpkgs/pkgs/development/compilers/llvm/12/lldb/resource-dir.patch
new file mode 100644
index 000000000000..e0db80afeb9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/llvm/12/lldb/resource-dir.patch
@@ -0,0 +1,13 @@
+diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
+index 37364341ff8b..7f74c1a3e257 100644
+--- a/cmake/modules/LLDBConfig.cmake
++++ b/cmake/modules/LLDBConfig.cmake
+@@ -257,7 +257,7 @@ if (NOT TARGET clang-resource-headers)
+   # Iterate over the possible places where the external resource directory
+   # could be and pick the first that exists.
+   foreach(CANDIDATE "${Clang_DIR}/../.." "${LLVM_DIR}" "${LLVM_LIBRARY_DIRS}"
+-                    "${LLVM_BUILD_LIBRARY_DIR}"
++                    "${LLVM_BUILD_LIBRARY_DIR}" "@clangLibDir@"
+                     "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}")
+     # Build the resource directory path by appending 'clang/<version number>'.
+     set(CANDIDATE_RESOURCE_DIR "${CANDIDATE}/clang/${LLDB_CLANG_RESOURCE_DIR_NAME}")