Skip to content

Commit 7432c04

Browse files
Vasileios KalintirisVasileios Kalintiris
Vasileios Kalintiris
authored and
Vasileios Kalintiris
committed
Revert "Introduce a cmake module to figure out whether we need to link with libatomic."
This reverts commit r260235. It breaks LLVM's bootstrap when building with a -gcc-toolchain and the system's gcc installation does not provide the libatomic library and its headers. We should check whether LIBCXX_GCC_TOOLCHAIN is set and adjust the flags accordingly. llvm-svn: 260323
1 parent 343f898 commit 7432c04

File tree

6 files changed

+0
-49
lines changed

6 files changed

+0
-49
lines changed

libcxx/cmake/Modules/CheckLibcxxAtomic.cmake

-38
This file was deleted.

libcxx/cmake/config-ix.cmake

-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
include(CheckLibraryExists)
22
include(CheckCXXCompilerFlag)
3-
include(CheckLibcxxAtomic)
43

54
# Check compiler flags
65

@@ -18,7 +17,3 @@ check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)
1817
check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
1918
check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
2019
check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
21-
22-
if (NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
23-
set(LIBCXX_HAS_ATOMIC_LIB True)
24-
endif()

libcxx/lib/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ add_library_flags_if(LIBCXX_HAS_C_LIB c)
7979
add_library_flags_if(LIBCXX_HAS_M_LIB m)
8080
add_library_flags_if(LIBCXX_HAS_RT_LIB rt)
8181
add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s)
82-
add_library_flags_if(LIBCXX_HAS_ATOMIC_LIB atomic)
8382

8483
# Setup flags.
8584
add_flags_if_supported(-fPIC)

libcxx/test/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pythonize_bool(LIBCXX_ENABLE_SHARED)
1515
pythonize_bool(LIBCXX_BUILD_32_BITS)
1616
pythonize_bool(LIBCXX_GENERATE_COVERAGE)
1717
pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
18-
pythonize_bool(LIBCXX_HAS_ATOMIC_LIB)
1918

2019
# The tests shouldn't link to any ABI library when it has been linked into
2120
# libc++ statically or via a linker script.

libcxx/test/libcxx/test/target_info.py

-3
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,6 @@ def add_cxx_link_flags(self, flags):
172172
flags += ['-lunwind', '-ldl']
173173
else:
174174
flags += ['-lgcc_s', '-lgcc']
175-
use_libatomic = self.full_config.get_lit_bool('use_libatomic', False)
176-
if use_libatomic:
177-
flags += ['-latomic']
178175
san = self.full_config.get_lit_conf('use_sanitizer', '').strip()
179176
if san:
180177
# The libraries and their order are taken from the

libcxx/test/lit.site.cfg.in

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ config.generate_coverage = "@LIBCXX_GENERATE_COVERAGE@"
2020
config.target_info = "@LIBCXX_TARGET_INFO@"
2121
config.executor = "@LIBCXX_EXECUTOR@"
2222
config.llvm_unwinder = "@LIBCXXABI_USE_LLVM_UNWINDER@"
23-
config.use_libatomic = "@LIBCXX_HAS_ATOMIC_LIB@"
2423

2524
# Let the main config do the real work.
2625
lit_config.load_config(config, "@LIBCXX_SOURCE_DIR@/test/lit.cfg")

0 commit comments

Comments
 (0)