[libcxx-commits] [libcxx] [libcxxabi] [libc++] Allow testing Apple's system library as it is installed (PR #99086)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 17 11:31:58 PDT 2024


================
@@ -114,8 +114,13 @@ for arch in ${architectures}; do
     #       Then LLVM would guess the LLVM_DEFAULT_TARGET_TRIPLE properly and we wouldn't have to specify it.
     target=$(xcrun clang -arch ${arch} -xc - -### 2>&1 | grep --only-matching -E '"-triple" ".+?"' | grep --only-matching -E '"[^ ]+-apple-[^ ]+?"' | tr -d '"')
 
-    step "Building libc++.dylib and libc++abi.dylib for architecture ${arch}"
     mkdir -p "${build_dir}/${arch}"
+
+    step "Building shims to make libc++ compatible with the system libc++ on Apple platforms when running the tests"
+    shims_library="${build_dir}/${arch}/apple-system-shims.a"
+    xcrun clang++ -c -std=c++2b -target ${target} "${llvm_root}/libcxxabi/src/vendor/apple/shims.cpp" -static -o "${shims_library}"
----------------
mordante wrote:

Does the C++ version need to match the version of the dylib? If not it would be good to comment that. If it needs to be we should add a comment in the CMakeLists.txt that sets the value to C++23.

Even cleaner would be to get the value from CMake, but that might be hard to do.

https://github.com/llvm/llvm-project/pull/99086


More information about the libcxx-commits mailing list