Skip to content

Commit f887fe0

Browse files
vitalybukacopybara-github
authored andcommitted
Revert "[runtimes] Probe for -nostdlib++ and -nostdinc++ with the C compiler" (#113653)
Reverts llvm/llvm-project#108357 Breaks https://lab.llvm.org/buildbot/#/builders/164/builds/3908 and similar bots NOKEYCHECK=True GitOrigin-RevId: 240e4780680f0d6a760be1b9ea432f410424b3a5
1 parent c54b50f commit f887fe0

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

cmake/config-ix.cmake

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,9 @@ endif()
3434
# required during compilation (which has the -nostdlib++ or -nodefaultlibs). libc is
3535
# required for the link to go through. We remove sanitizers from the
3636
# configuration checks to avoid spurious link errors.
37-
#
38-
# Adding flags to CMAKE_REQUIRED_FLAGS will include the flags both when testing
39-
# compilation of C and C++. Therefore test to make sure that the flags are
40-
# supported by the C compiler driver, before deciding to include them.
4137

42-
llvm_check_compiler_linker_flag(C "-nostdlib++" C_SUPPORTS_NOSTDLIBXX_FLAG)
43-
if (C_SUPPORTS_NOSTDLIBXX_FLAG)
38+
llvm_check_compiler_linker_flag(CXX "-nostdlib++" CXX_SUPPORTS_NOSTDLIBXX_FLAG)
39+
if (CXX_SUPPORTS_NOSTDLIBXX_FLAG)
4440
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdlib++")
4541
else()
4642
llvm_check_compiler_linker_flag(C "-nodefaultlibs" C_SUPPORTS_NODEFAULTLIBS_FLAG)
@@ -51,7 +47,7 @@ endif()
5147

5248
# Only link against compiler-rt manually if we use -nodefaultlibs, since
5349
# otherwise the compiler will do the right thing on its own.
54-
if (NOT C_SUPPORTS_NOSTDLIBXX_FLAG AND C_SUPPORTS_NODEFAULTLIBS_FLAG)
50+
if (NOT CXX_SUPPORTS_NOSTDLIBXX_FLAG AND C_SUPPORTS_NODEFAULTLIBS_FLAG)
5551
if (LIBUNWIND_HAS_C_LIB)
5652
list(APPEND CMAKE_REQUIRED_LIBRARIES c)
5753
endif ()
@@ -86,7 +82,7 @@ if (NOT C_SUPPORTS_NOSTDLIBXX_FLAG AND C_SUPPORTS_NODEFAULTLIBS_FLAG)
8682
endif()
8783
endif()
8884

89-
if (C_SUPPORTS_NOSTDLIBXX_FLAG OR C_SUPPORTS_NODEFAULTLIBS_FLAG)
85+
if (CXX_SUPPORTS_NOSTDLIBXX_FLAG OR C_SUPPORTS_NODEFAULTLIBS_FLAG)
9086
if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
9187
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")
9288
endif ()

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ set(LIBUNWIND_SOURCES
6666
${LIBUNWIND_ASM_SOURCES})
6767

6868
# Generate library list.
69-
if (C_SUPPORTS_NOSTDLIBXX_FLAG)
69+
if (CXX_SUPPORTS_NOSTDLIBXX_FLAG)
7070
add_link_flags_if_supported(-nostdlib++)
7171
else()
7272
if (LIBUNWIND_USE_COMPILER_RT)

0 commit comments

Comments
 (0)