[libcxx-commits] [libcxx] [libc++abi][test][VE] Add '-ldl' to support VE (PR #66605)

Kazushi Marukawa via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 18 21:43:22 PDT 2023


https://github.com/kaz7 updated https://github.com/llvm/llvm-project/pull/66605

>From c0d46e9315be301f4697eea1c68933167deb7ca6 Mon Sep 17 00:00:00 2001
From: "Kazushi (Jam) Marukawa" <marukawa at nec.com>
Date: Mon, 18 Sep 2023 06:30:58 +0200
Subject: [PATCH] [libc++][libc++abi][test][VE] Add '-ldl' to support VE

Tests are linked under -nostdlib++ option, so it is required to add
system's libraries correctly.  So, I add configuration file for ve
and add libdl.so which is required for VE.
---
 libcxx/test/configs/ve-libc++-shared.cfg.in   | 28 +++++++++++++++++++
 .../test/configs/ve-libc++abi-shared.cfg.in   | 28 +++++++++++++++++++
 2 files changed, 56 insertions(+)
 create mode 100644 libcxx/test/configs/ve-libc++-shared.cfg.in
 create mode 100644 libcxxabi/test/configs/ve-libc++abi-shared.cfg.in

diff --git a/libcxx/test/configs/ve-libc++-shared.cfg.in b/libcxx/test/configs/ve-libc++-shared.cfg.in
new file mode 100644
index 000000000000000..d764f2183fc6425
--- /dev/null
+++ b/libcxx/test/configs/ve-libc++-shared.cfg.in
@@ -0,0 +1,28 @@
+# This testing configuration handles running the test suite against LLVM's
+# libc++ for VE using a shared library.
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+config.substitutions.append(('%{flags}',
+    '-pthread' + (' -isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '')
+))
+config.substitutions.append(('%{compile_flags}',
+    '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support'
+))
+# VE requires libdl library.
+config.substitutions.append(('%{link_flags}',
+    '-nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++ -ldl'
+))
+config.substitutions.append(('%{exec}',
+    '%{executor} --execdir %T -- '
+))
+
+import os, site
+site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
+    libcxx.test.params.DEFAULT_PARAMETERS,
+    libcxx.test.features.DEFAULT_FEATURES,
+    config,
+    lit_config
+)
diff --git a/libcxxabi/test/configs/ve-libc++abi-shared.cfg.in b/libcxxabi/test/configs/ve-libc++abi-shared.cfg.in
new file mode 100644
index 000000000000000..4b6d71c66307981
--- /dev/null
+++ b/libcxxabi/test/configs/ve-libc++abi-shared.cfg.in
@@ -0,0 +1,28 @@
+# This testing configuration handles running the test suite against LLVM's
+# libc++abi for VE using a shared library.
+
+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} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -I %{libcxx}/test/support -I %{libcxx}/src -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS'
+))
+# VE requires libdl library.
+config.substitutions.append(('%{link_flags}',
+    '-nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++ -lc++abi -pthread -ldl'
+))
+config.substitutions.append(('%{exec}',
+    '%{executor} --execdir %T -- '
+))
+
+import os, site
+site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
+    libcxx.test.params.DEFAULT_PARAMETERS,
+    libcxx.test.features.DEFAULT_FEATURES,
+    config,
+    lit_config
+)



More information about the libcxx-commits mailing list