[libcxx-commits] [libcxx] 9892d16 - [libc++][libc++abi] Add tests for vendor-specific properties

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 29 14:22:41 PDT 2021


Author: Louis Dionne
Date: 2021-09-29T17:22:37-04:00
New Revision: 9892d1644f62cf8f5133ee0d2ebafb56f6500cc1

URL: https://github.com/llvm/llvm-project/commit/9892d1644f62cf8f5133ee0d2ebafb56f6500cc1
DIFF: https://github.com/llvm/llvm-project/commit/9892d1644f62cf8f5133ee0d2ebafb56f6500cc1.diff

LOG: [libc++][libc++abi] Add tests for vendor-specific properties

Vendors take libc++ and ship it in various ways. Some vendors might
ship it differently from what upstream LLVM does, i.e. the install
location might be different, some ABI properties might differ, etc.

In the past few years, I've come across several instances where
having a place to test some of these properties would have been
incredibly useful. I also just got bitten by the lack of tests
of that kind, so I'm adding some now.

The tests added by this commit for Apple platforms have numerous
TODOs that capture discrepancies between the upstream LLVM CMake
and the slightly-modified build we perform internally to produce
Apple's system libc++. In the future, the goal would be to upstream
all those differences so that it's possible to build a faithful
Apple system libc++ with the upstream LLVM sources only.

But this isn't only useful for Apple - this lays out the path for
any vendor being able to add their own checks (either upstream or
downstream) to libc++.

Differential Revision: https://reviews.llvm.org/D110736

Added: 
    libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp
    libcxxabi/test/vendor/apple/system-install-properties.sh.cpp

Modified: 
    libcxx/cmake/caches/Apple.cmake
    libcxx/test/configs/legacy.cfg.in
    libcxx/test/configs/libcxx-trunk-shared.cfg.in
    libcxx/test/configs/libcxx-trunk-static.cfg.in
    libcxx/test/std/strings/c.strings/cuchar.pass.cpp
    libcxx/test/std/utilities/charconv/charconv.from.chars/integral.bool.fail.cpp
    libcxx/test/std/utilities/charconv/charconv.from.chars/integral.pass.cpp
    libcxx/test/std/utilities/charconv/charconv.from.chars/integral.roundtrip.pass.cpp
    libcxx/test/std/utilities/charconv/charconv.to.chars/integral.bool.fail.cpp
    libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp
    libcxx/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp
    libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
    libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
    libcxx/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp
    libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp
    libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
    libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
    libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp
    libcxx/utils/libcxx/test/config.py
    libcxx/utils/libcxx/test/params.py
    libcxxabi/test/lit.site.cfg.in

Removed: 
    


################################################################################
diff  --git a/libcxx/cmake/caches/Apple.cmake b/libcxx/cmake/caches/Apple.cmake
index c884eb561d041..6f4030ec05b63 100644
--- a/libcxx/cmake/caches/Apple.cmake
+++ b/libcxx/cmake/caches/Apple.cmake
@@ -18,3 +18,6 @@ set(LIBCXXABI_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "")
 
 set(LIBCXXABI_ENABLE_ASSERTIONS OFF CACHE BOOL "")
 set(LIBCXXABI_ENABLE_FORGIVING_DYNAMIC_CAST ON CACHE BOOL "")
+
+set(LIBCXX_TEST_PARAMS "stdlib=apple-libc++" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")

diff  --git a/libcxx/test/configs/legacy.cfg.in b/libcxx/test/configs/legacy.cfg.in
index 23aa5051eaea6..a131978b97a27 100644
--- a/libcxx/test/configs/legacy.cfg.in
+++ b/libcxx/test/configs/legacy.cfg.in
@@ -8,6 +8,7 @@ import site
 config.cxx_headers              = "@LIBCXX_GENERATED_INCLUDE_DIR@"
 config.cxx_under_test           = "@CMAKE_CXX_COMPILER@"
 config.project_obj_root         = "@CMAKE_BINARY_DIR@"
+config.install_root             = "@CMAKE_BINARY_DIR@"
 config.libcxx_src_root          = "@LIBCXX_SOURCE_DIR@"
 config.libcxx_obj_root          = "@LIBCXX_BINARY_DIR@"
 config.cxx_library_root         = "@LIBCXX_LIBRARY_DIR@"

diff  --git a/libcxx/test/configs/libcxx-trunk-shared.cfg.in b/libcxx/test/configs/libcxx-trunk-shared.cfg.in
index 3711d5d321434..1cc51bd87c796 100644
--- a/libcxx/test/configs/libcxx-trunk-shared.cfg.in
+++ b/libcxx/test/configs/libcxx-trunk-shared.cfg.in
@@ -49,6 +49,7 @@ config.substitutions.append(('%{exec}',
         pipes.quote(sys.executable),
         pipes.quote(runPy))
 ))
+config.substitutions.append(('%{install}', INSTALL_ROOT))
 
 # Add parameters and features to the config
 libcxx.test.newconfig.configure(

diff  --git a/libcxx/test/configs/libcxx-trunk-static.cfg.in b/libcxx/test/configs/libcxx-trunk-static.cfg.in
index 07f5890699fe0..6aeeb329994ef 100644
--- a/libcxx/test/configs/libcxx-trunk-static.cfg.in
+++ b/libcxx/test/configs/libcxx-trunk-static.cfg.in
@@ -49,6 +49,7 @@ config.substitutions.append(('%{exec}',
         pipes.quote(sys.executable),
         pipes.quote(runPy))
 ))
+config.substitutions.append(('%{install}', INSTALL_ROOT))
 
 # Add parameters and features to the config
 libcxx.test.newconfig.configure(

diff  --git a/libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp b/libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp
new file mode 100644
index 0000000000000..ff14dda2f0b21
--- /dev/null
+++ b/libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp
@@ -0,0 +1,45 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: stdlib=apple-libc++
+
+// This file checks various properties of the installation of libc++ when built as
+// a system library on Apple platforms.
+//
+// TODO: We should install to `<prefix>/usr` in CMake and check that path instead.
+
+// Make sure we install the libc++ headers in the right location.
+//
+// RUN: stat "%{install}/include/c++/v1/__config"
+
+// Make sure we install libc++.1.dylib in the right location.
+//
+// RUN: stat "%{install}/lib/libc++.1.dylib"
+
+// Make sure we install a symlink from libc++.dylib to libc++.1.dylib.
+//
+// RUN: stat "%{install}/lib/libc++.dylib"
+// RUN: readlink "%{install}/lib/libc++.dylib" | grep "libc++.1.dylib"
+
+// Make sure the install_name is /usr/lib.
+//
+// In particular, make sure we don't use any @rpath in the load commands. When building as
+// a system library, it is important to hardcode the installation paths in the dylib, because
+// various tools like dyld and ld64 will treat us specially if they recognize us as being a
+// system library.
+//
+// TODO: We currently don't do that correctly in the CMake build.
+//
+// XRUNX: otool -L "%{install}/lib/libc++.1.dylib" | grep '/usr/lib/libc++.1.dylib'
+// XRUNX: ! otool -l "%{install}/lib/libc++.1.dylib" | grep -E "LC_RPATH|@loader_path|@rpath"
+
+// Make sure the compatibility_version of libc++ is 1.0.0.
+// Failure to respect this can result in applications not being able to find libc++
+// when they are loaded by dyld, if the compatibility version was bumped.
+//
+// RUN: otool -L "%{install}/lib/libc++.1.dylib" | grep "libc++.1.dylib" | grep "compatibility version 1.0.0"

diff  --git a/libcxx/test/std/strings/c.strings/cuchar.pass.cpp b/libcxx/test/std/strings/c.strings/cuchar.pass.cpp
index b63df56c42952..d0f6142acd6b1 100644
--- a/libcxx/test/std/strings/c.strings/cuchar.pass.cpp
+++ b/libcxx/test/std/strings/c.strings/cuchar.pass.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: stdlib=libc++
+// XFAIL: stdlib={{.+}}-libc++
 
 // Skip this test on windows. If built on top of the MSVC runtime, the
 // <cuchar> header actually does exist (although not provided by us).

diff  --git a/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.bool.fail.cpp b/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.bool.fail.cpp
index d77131775dfcb..5d7b6450d2ef1 100644
--- a/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.bool.fail.cpp
+++ b/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.bool.fail.cpp
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03
-// UNSUPPORTED: !stdlib=libc++ && c++11
-// UNSUPPORTED: !stdlib=libc++ && c++14
+// UNSUPPORTED: !stdlib={{.+}}-libc++ && c++11
+// UNSUPPORTED: !stdlib={{.+}}-libc++ && c++14
 // <charconv>
 
 // In

diff  --git a/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.pass.cpp b/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.pass.cpp
index 0c10c0dfb5bca..350b1bf12c65a 100644
--- a/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.pass.cpp
+++ b/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.pass.cpp
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03
-// UNSUPPORTED: !stdlib=libc++ && c++11
-// UNSUPPORTED: !stdlib=libc++ && c++14
+// UNSUPPORTED: !stdlib={{.+}}-libc++ && c++11
+// UNSUPPORTED: !stdlib={{.+}}-libc++ && c++14
 
 // <charconv>
 

diff  --git a/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.roundtrip.pass.cpp b/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.roundtrip.pass.cpp
index 6aa49534d243d..a57a70911ffab 100644
--- a/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.roundtrip.pass.cpp
+++ b/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.roundtrip.pass.cpp
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03
-// UNSUPPORTED: !stdlib=libc++ && c++11
-// UNSUPPORTED: !stdlib=libc++ && c++14
+// UNSUPPORTED: !stdlib={{.+}}-libc++ && c++11
+// UNSUPPORTED: !stdlib={{.+}}-libc++ && c++14
 
 // The roundtrip test uses to_chars, which requires functions in the dylib
 // that were introduced in Mac OS 10.15.

diff  --git a/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.bool.fail.cpp b/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.bool.fail.cpp
index 096d979a2fc1c..81ce986e2820d 100644
--- a/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.bool.fail.cpp
+++ b/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.bool.fail.cpp
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03
-// UNSUPPORTED: !stdlib=libc++ && c++11
-// UNSUPPORTED: !stdlib=libc++ && c++14
+// UNSUPPORTED: !stdlib={{.+}}-libc++ && c++11
+// UNSUPPORTED: !stdlib={{.+}}-libc++ && c++14
 // <charconv>
 
 // In

diff  --git a/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp b/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp
index d137461ea3bc2..fab0c968edc48 100644
--- a/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp
+++ b/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03
-// UNSUPPORTED: !stdlib=libc++ && c++11
-// UNSUPPORTED: !stdlib=libc++ && c++14
+// UNSUPPORTED: !stdlib={{.+}}-libc++ && c++11
+// UNSUPPORTED: !stdlib={{.+}}-libc++ && c++14
 
 // to_chars requires functions in the dylib that were introduced in Mac OS 10.15.
 //

diff  --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp
index 8bcd525f9a148..9d6bc5011e03b 100644
--- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: stdlib=libc++
+// XFAIL: stdlib={{.+}}-libc++
 
 // <functional>
 

diff  --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
index 3ff0f0d27f675..170a2ba5f64ff 100644
--- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: stdlib=libc++
+// XFAIL: stdlib={{.+}}-libc++
 
 // <functional>
 

diff  --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
index e4e72be2b6b37..1a0e27bf518b8 100644
--- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: stdlib=libc++
+// XFAIL: stdlib={{.+}}-libc++
 
 // <functional>
 

diff  --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp
index f6f88518c8889..6ca2962ce22d0 100644
--- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: stdlib=libc++
+// XFAIL: stdlib={{.+}}-libc++
 
 // <functional>
 

diff  --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp
index 828d6fc72157e..266ceb8e16d69 100644
--- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: stdlib=libc++
+// XFAIL: stdlib={{.+}}-libc++
 
 // <functional>
 

diff  --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
index 904623ff27819..237211e674366 100644
--- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: stdlib=libc++
+// XFAIL: stdlib={{.+}}-libc++
 
 // <functional>
 

diff  --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
index 53700884cd446..22d40b6e4b377 100644
--- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: stdlib=libc++
+// XFAIL: stdlib={{.+}}-libc++
 
 // <functional>
 

diff  --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp
index 137d1a66ad32c..acc229542e188 100644
--- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: stdlib=libc++
+// XFAIL: stdlib={{.+}}-libc++
 
 // <functional>
 

diff  --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index 3cd0db454964b..77827df261b1c 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -467,6 +467,7 @@ def configure_substitutions(self):
         sub.append(('%{flags}',         ' '.join(map(self.quote, flags))))
         sub.append(('%{compile_flags}', ' '.join(map(self.quote, compile_flags))))
         sub.append(('%{link_flags}',    ' '.join(map(self.quote, self.cxx.link_flags))))
+        sub.append(('%{install}',       self.quote(self.config.install_root)))
 
         codesign_ident = self.get_lit_conf('llvm_codesign_identity', '')
         env_vars = ' '.join('%s=%s' % (k, self.quote(v)) for (k, v) in self.exec_env.items())

diff  --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index 090e0589789a7..ec80b9ab2b6af 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -91,8 +91,21 @@ def getStdFlag(cfg, std):
               AddCompileFlag('-fno-rtti')
             ]),
 
-  Parameter(name='stdlib', choices=['libc++', 'libstdc++', 'msvc'], type=str, default='libc++',
-            help="The C++ Standard Library implementation being tested.",
+  Parameter(name='stdlib', choices=['llvm-libc++', 'apple-libc++', 'libstdc++', 'msvc'], type=str, default='llvm-libc++',
+            help="""The C++ Standard Library implementation being tested.
+
+                 Note that this parameter can also be used to encode 
diff erent 'flavors' of the same
+                 standard library, such as libc++ as shipped by a 
diff erent vendor, if it has 
diff erent
+                 properties worth testing.
+
+                 The Standard libraries currently supported are:
+                 - llvm-libc++: The 'upstream' libc++ as shipped with LLVM.
+                 - apple-libc++: libc++ as shipped by Apple. This is basically like the LLVM one, but
+                                 there are a few 
diff erences like installation paths and the use of
+                                 universal dylibs.
+                 - libstdc++: The GNU C++ library typically shipped with GCC.
+                 - msvc: The Microsoft implementation of the C++ Standard Library.
+                """,
             actions=lambda stdlib: [
               AddFeature('stdlib={}'.format(stdlib))
             ]),

diff  --git a/libcxxabi/test/lit.site.cfg.in b/libcxxabi/test/lit.site.cfg.in
index 049f822b5ed56..585e03e8222f9 100644
--- a/libcxxabi/test/lit.site.cfg.in
+++ b/libcxxabi/test/lit.site.cfg.in
@@ -7,6 +7,7 @@ import site
 
 config.cxx_under_test           = "@CMAKE_CXX_COMPILER@"
 config.project_obj_root         = "@CMAKE_BINARY_DIR@"
+config.install_root             = "@CMAKE_BINARY_DIR@"
 config.libcxxabi_hdr_root       = "@LIBCXXABI_HEADER_DIR@"
 config.libcxxabi_src_root       = "@LIBCXXABI_SOURCE_DIR@"
 config.libcxxabi_obj_root       = "@LIBCXXABI_BINARY_DIR@"

diff  --git a/libcxxabi/test/vendor/apple/system-install-properties.sh.cpp b/libcxxabi/test/vendor/apple/system-install-properties.sh.cpp
new file mode 100644
index 0000000000000..791fc67d33a86
--- /dev/null
+++ b/libcxxabi/test/vendor/apple/system-install-properties.sh.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: stdlib=apple-libc++
+
+// This file checks various properties of the installation of libc++abi when built
+// as a system library on Apple platforms.
+//
+// TODO: We should install to `<prefix>/usr` in CMake and check that path instead.
+
+// Make sure we install the libc++abi headers in the right location.
+// TODO: We don't currently install them, but we should.
+//
+// XRUNX: stat "%{install}/include/cxxabi.h"
+
+// Make sure we install libc++abi.dylib in the right location.
+//
+// RUN: stat "%{install}/lib/libc++abi.dylib"
+
+// Make sure we don't install a symlink from libc++abi.dylib to libc++abi.1.dylib,
+// unlike what we do for libc++.dylib.
+// TODO: We currently don't do that correctly in the CMake build.
+//
+// XRUNX: ! readlink "%{install}/lib/libc++abi.dylib"
+// XRUNX: ! stat "%{install}/lib/libc++abi.1.dylib"
+
+// Make sure the install_name is /usr/lib.
+//
+// In particular, make sure we don't use any @rpath in the load commands. When building as
+// a system library, it is important to hardcode the installation paths in the dylib, because
+// various tools like dyld and ld64 will treat us specially if they recognize us as being a
+// system library.
+//
+// TODO: We currently don't do that correctly in the CMake build.
+//
+// XRUNX: otool -L "%{install}/lib/libc++abi.dylib" | grep '/usr/lib/libc++abi.dylib'
+// XRUNX: ! otool -l "%{install}/lib/libc++abi.dylib" | grep -E "LC_RPATH|@loader_path|@rpath"
+
+// Make sure the compatibility_version of libc++abi is 1.0.0. Failure to respect this can result
+// in applications not being able to find libc++abi when they are loaded by dyld, if the
+// compatibility version was bumped.
+//
+// RUN: otool -L "%{install}/lib/libc++abi.dylib" | grep "libc++abi.1.dylib" | grep "compatibility version 1.0.0"


        


More information about the libcxx-commits mailing list