[libcxx-commits] [libcxx] [libcxxabi] [libc++] Return to using DYLD_LIBRARY_PATH for the system libc++ tests (PR #98070)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 16 09:28:13 PDT 2024


================
@@ -0,0 +1,35 @@
+# Testing configuration for Apple's system libc++.
+#
+# This configuration differs from a normal LLVM shared library configuration in
+# that we must use DYLD_LIBRARY_PATH to run the tests against the just-built library,
+# since Apple's libc++ has an absolute install_name.
+#
+# We also don't use a per-target include directory layout, so we have only one
+# include directory for the libc++ headers.
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+config.substitutions.append(('%{flags}',
+    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
+))
+config.substitutions.append(('%{compile_flags}',
+    '-nostdinc++ -I %{include-dir} -I %{libcxx-dir}/test/support'
+))
+config.substitutions.append(('%{link_flags}',
+    '-nostdlib++ -L %{lib-dir} -lc++'
+))
+config.substitutions.append(('%{exec}',
+    '%{executor} --execdir %T --env DYLD_LIBRARY_PATH=%{lib-dir} -- '
----------------
ldionne wrote:

>From Mark: We could look into use `DYLD_INSERT_LIBRARIES` instead to preload a library that only contains the shims. That would make the fix a lot more localized.

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


More information about the libcxx-commits mailing list