Merge pull request #187737 from obsidiansystems/bump_llvm_git

llvmPackages_git.libcxxabi: Replace vendored patch with fetch
This commit is contained in:
John Ericson 2022-08-21 09:51:20 -04:00 committed by GitHub
commit 520040da1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 47 deletions

View File

@ -1,5 +1,5 @@
{ lib, stdenv, llvm_meta, cmake, python3
, monorepoSrc, runCommand
, monorepoSrc, runCommand, fetchpatch
, cxx-headers, libunwind, version
, enableShared ? !stdenv.hostPlatform.isStatic
}:
@ -39,7 +39,13 @@ stdenv.mkDerivation rec {
patches = [
./gnu-install-dirs.patch
./skip-other-project-tests.patch
# https://reviews.llvm.org/D132298, Allow building libcxxabi alone
(fetchpatch {
url = "https://github.com/llvm/llvm-project/commit/e6a0800532bb409f6d1c62f3698bdd6994a877dc.patch";
sha256 = "1xyjd56m4pfwq8p3xh6i8lhkk9kq15jaml7qbhxdf87z4jjkk63a";
stripLen = 1;
})
];
postPatch = ''

View File

@ -1,45 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -131,10 +131,21 @@ if (NOT LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_STATIC)
message(FATAL_ERROR "libc++abi must be built as either a shared or static library.")
endif()
-# TODO: Remove this, which shouldn't be necessary since we know we're being built
-# side-by-side with libc++.
set(LIBCXXABI_LIBCXX_INCLUDES "" CACHE PATH
"Specify path to libc++ includes.")
+if (NOT libcxx IN_LIST LLVM_ENABLE_RUNTIMES)
+ if (NOT IS_DIRECTORY ${LIBCXXABI_LIBCXX_INCLUDES})
+ message(FATAL_ERROR
+ "LIBCXXABI_LIBCXX_INCLUDES=${LIBCXXABI_LIBCXX_INCLUDES} is not a valid directory. "
+ "Please provide the path to where the libc++ headers have been installed.")
+ endif()
+ add_library(cxx-headers INTERFACE)
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
+ target_compile_options(cxx-headers INTERFACE /I "${LIBCXXABI_LIBCXX_INCLUDES}")
+ else()
+ target_compile_options(cxx-headers INTERFACE -I "${LIBCXXABI_LIBCXX_INCLUDES}")
+ endif()
+endif()
set(LIBCXXABI_HERMETIC_STATIC_LIBRARY_DEFAULT OFF)
if (WIN32)
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -61,9 +61,13 @@ if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
list(APPEND LIBCXXABI_TEST_DEPS cxx_external_threads)
endif()
-list(APPEND LIBCXXABI_TEST_DEPS cxx)
-if (LIBCXXABI_USE_LLVM_UNWINDER AND TARGET unwind)
- list(APPEND LIBCXXABI_TEST_DEPS unwind)
+if(libcxx IN_LIST LLVM_ENABLE_RUNTIMES)
+ list(APPEND LIBCXXABI_TEST_DEPS cxx)
+endif()
+if(libunwind IN_LIST LLVM_ENABLE_RUNTIMES)
+ if (LIBCXXABI_USE_LLVM_UNWINDER AND TARGET unwind)
+ list(APPEND LIBCXXABI_TEST_DEPS unwind)
+ endif()
endif()
set(AUTO_GEN_COMMENT "## Autogenerated by libcxxabi configuration.\n# Do not edit!")