Skip to content

Commit 55bd3f8

Browse files
committed
Try it a different way
1 parent ab03bfc commit 55bd3f8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

flang-rt/cmake/modules/AddFlangRT.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ function (add_flangrt_library name)
286286
# For Flang-RT's configured config.h to be found
287287
target_include_directories(${tgtname} PRIVATE "${FLANG_RT_BINARY_DIR}")
288288

289+
# Define our own _GLIBCXX_THROW_OR_ABORT because libstdc++ headers
290+
# reference std::exception in its definition, and we do not want
291+
# to link against std::exception since doing that would link us to
292+
# the C++ runtime.
293+
target_compile_definitions(${tgtname} PUBLIC "_GLIBCXX_THROW_OR_ABORT=(__builtin_abort())")
294+
289295
# Disable libstdc++/libc++ assertions, even in an LLVM_ENABLE_ASSERTIONS
290296
# build, to avoid an unwanted dependency on libstdc++/libc++.so.
291297
target_compile_definitions(${tgtname} PUBLIC _GLIBCXX_NO_ASSERTIONS)

0 commit comments

Comments
 (0)