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

Kazushi Marukawa via libcxx-commits libcxx-commits at lists.llvm.org
Sun Sep 17 16:36:55 PDT 2023


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

Tests are linked under -nostdlib++ option, so it is required to add system's libraries correctly.  So, I add libdl.so which is required for VE.

>From 1e74ab53d37a5124603c19bf0916bb89ca0b85c2 Mon Sep 17 00:00:00 2001
From: "Kazushi (Jam) Marukawa" <marukawa at nec.com>
Date: Fri, 25 Aug 2023 15:51:12 +0200
Subject: [PATCH] [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 libdl.so which is required
for VE.
---
 libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in b/libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in
index 6b69205da77c992..bb9a6514648e967 100644
--- a/libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in
+++ b/libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in
@@ -9,13 +9,20 @@ config.substitutions.append(('%{flags}',
 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'
 ))
-config.substitutions.append(('%{link_flags}',
-    '-nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++ -lc++abi -pthread'
-))
 config.substitutions.append(('%{exec}',
     '%{executor} --execdir %T -- '
 ))
 
+if config.root.target_triple.startswith('ve-'):
+  # VE requires libdl library.
+  config.substitutions.append(('%{link_flags}',
+      '-nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++ -lc++abi -pthread -ldl'
+  ))
+else:
+  config.substitutions.append(('%{link_flags}',
+      '-nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++ -lc++abi -pthread'
+  ))
+
 import os, site
 site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
 import libcxx.test.params, libcxx.test.config



More information about the libcxx-commits mailing list