Skip to content

Commit d217aeb

Browse files
authored
[runtimes] Simplify testing configurations on GCC by using -nostdlib++ (llvm#67021)
Since GCC now supports -nostdlib++, we can remove some complexity in the test configurations and do the same as Clang. However, we can't fully remove the GCC test configuration for libc++ because we apparently need to explicitly link against libm for some tests to work.
1 parent 29f8e23 commit d217aeb

File tree

3 files changed

+3
-31
lines changed

3 files changed

+3
-31
lines changed

libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This testing configuration handles running the test suite against LLVM's libc++
22
# using a shared library, with GCC. This is done differently from Clang because
3-
# GCC does not support the -nostdlib++ command-line flag.
3+
# we need to explicitly link against libm for some tests with GCC.
44

55
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
66

@@ -9,7 +9,7 @@ config.substitutions.append(('%{compile_flags}',
99
'-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support'
1010
))
1111
config.substitutions.append(('%{link_flags}',
12-
'-L %{lib} -Wl,-rpath,%{lib} -nodefaultlibs -lc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc -latomic'
12+
'-nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++ -lm'
1313
))
1414
config.substitutions.append(('%{exec}',
1515
'%{executor} --execdir %T -- '

libcxxabi/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ endif()
144144
option(LIBCXXABI_HERMETIC_STATIC_LIBRARY
145145
"Do not export any symbols from the static library." ${LIBCXXABI_HERMETIC_STATIC_LIBRARY_DEFAULT})
146146

147-
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
148-
set(LIBCXXABI_DEFAULT_TEST_CONFIG "llvm-libc++abi-shared-gcc.cfg.in")
149-
elseif(MINGW)
147+
if(MINGW)
150148
set(LIBCXXABI_DEFAULT_TEST_CONFIG "llvm-libc++abi-mingw.cfg.in")
151149
elseif(WIN32) # clang-cl
152150
if (LIBCXXABI_ENABLE_SHARED)

libcxxabi/test/configs/llvm-libc++abi-shared-gcc.cfg.in

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)