Skip to content

Commit 7783bba

Browse files
committed
[flang] Disable libstdc++ assertions in the runtime library
Differential Revision: https://reviews.llvm.org/D143168
1 parent 146f5d9 commit 7783bba

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

flang/lib/Decimal/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ if (FLANG_RUNTIME_HAS_FNO_LTO_FLAG)
4242
append("-fno-lto" CMAKE_CXX_FLAGS)
4343
endif()
4444

45-
45+
# Disable libstdc++ assertions, even in an LLVM_ENABLE_ASSERTIONS build, to
46+
# avoid an unwanted dependency on libstdc++.so.
47+
add_definitions(-U_GLIBCXX_ASSERTIONS)
4648

4749
add_flang_library(FortranDecimal INSTALL_WITH_TOOLCHAIN
4850
binary-to-decimal.cpp

flang/runtime/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR})
8686
append(${NO_LTO_FLAGS} CMAKE_C_FLAGS)
8787
append(${NO_LTO_FLAGS} CMAKE_CXX_FLAGS)
8888

89+
# Disable libstdc++ assertions, even in an LLVM_ENABLE_ASSERTIONS build, to
90+
# avoid an unwanted dependency on libstdc++.so.
91+
add_definitions(-U_GLIBCXX_ASSERTIONS)
92+
8993
add_subdirectory(FortranMain)
9094

9195
add_flang_library(FortranRuntime

0 commit comments

Comments
 (0)