[libcxx-commits] [libcxx] d58ba7a - [libc++][test] Makes pthread a flag.
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 3 09:35:50 PDT 2023
Author: Mark de Wever
Date: 2023-05-03T18:35:41+02:00
New Revision: d58ba7a4d145c60039d9a87f7265e56716e3bedd
URL: https://github.com/llvm/llvm-project/commit/d58ba7a4d145c60039d9a87f7265e56716e3bedd
DIFF: https://github.com/llvm/llvm-project/commit/d58ba7a4d145c60039d9a87f7265e56716e3bedd.diff
LOG: [libc++][test] Makes pthread a flag.
Using pthread may affect the compilation too not only the linking.
Therefore pthread is changed from a link flag to a generic flag used for
both compilation and linking.
This fixes an issue when using modules since the use of the pthread flag
makes the BMI files not compatible.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D149453
Added:
Modified:
libcxx/test/configs/ibm-libc++-shared.cfg.in
libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
libcxx/test/configs/llvm-libc++-shared.cfg.in
libcxx/test/configs/llvm-libc++-static.cfg.in
Removed:
################################################################################
diff --git a/libcxx/test/configs/ibm-libc++-shared.cfg.in b/libcxx/test/configs/ibm-libc++-shared.cfg.in
index a93b3085c21ca..7881556603cfa 100644
--- a/libcxx/test/configs/ibm-libc++-shared.cfg.in
+++ b/libcxx/test/configs/ibm-libc++-shared.cfg.in
@@ -4,9 +4,9 @@
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
-config.substitutions.append(('%{flags}', ''))
+config.substitutions.append(('%{flags}', '-pthread'))
config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -D__LIBC_NO_CPP_MATH_OVERLOADS__ -I %{include} -I %{libcxx}/test/support -pthread'
+ '-nostdinc++ -D__LIBC_NO_CPP_MATH_OVERLOADS__ -I %{include} -I %{libcxx}/test/support'
))
config.substitutions.append(('%{link_flags}',
'-nostdlib++ -L %{lib} -lc++ -lc++abi -latomic -Wl,-bbigtoc'
diff --git a/libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in b/libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
index eeeafcf0c99b2..df4aaa311dc49 100644
--- a/libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
@@ -4,12 +4,12 @@
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
-config.substitutions.append(('%{flags}', ''))
+config.substitutions.append(('%{flags}', '-pthread'))
config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support'
))
config.substitutions.append(('%{link_flags}',
- '-L %{lib} -Wl,-rpath,%{lib} -nodefaultlibs -lc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc -latomic'
+ '-L %{lib} -Wl,-rpath,%{lib} -nodefaultlibs -lc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc -latomic'
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T -- '
diff --git a/libcxx/test/configs/llvm-libc++-shared.cfg.in b/libcxx/test/configs/llvm-libc++-shared.cfg.in
index eb86b88f956ad..143b3b3feae11 100644
--- a/libcxx/test/configs/llvm-libc++-shared.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-shared.cfg.in
@@ -4,13 +4,13 @@
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 ''
+ '-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'
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++ -pthread'
+ '-nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++'
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T -- '
diff --git a/libcxx/test/configs/llvm-libc++-static.cfg.in b/libcxx/test/configs/llvm-libc++-static.cfg.in
index 8b66a129098be..e866d4f52a062 100644
--- a/libcxx/test/configs/llvm-libc++-static.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-static.cfg.in
@@ -4,13 +4,13 @@
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 ''
+ '-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'
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib++ -L %{lib} -lc++ -lc++abi -pthread'
+ '-nostdlib++ -L %{lib} -lc++ -lc++abi'
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T -- '
More information about the libcxx-commits
mailing list