Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
[OpenMP] Remove unwanted dependency on libstdc++ for libomp (#258)
Browse files Browse the repository at this point in the history
Disable libstdc++/libc++ assertions, in an `LLVM_ENABLE_ASSERTIONS` build, to avoid an unwanted dependency on libstdc++/libc++.so.

fixes #73248

Note: Applies upstream diff: llvm/llvm-project#73249
  • Loading branch information
ergawy committed Jan 15, 2024
1 parent 1657ee7 commit b1d69b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions openmp/runtime/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ libomp_get_asmflags(LIBOMP_CONFIGURED_ASMFLAGS)
set_source_files_properties(${LIBOMP_CXXFILES} PROPERTIES COMPILE_FLAGS "${LIBOMP_CONFIGURED_CXXFLAGS}")
set_source_files_properties(${LIBOMP_ASMFILES} ${LIBOMP_GNUASMFILES} PROPERTIES COMPILE_FLAGS "${LIBOMP_CONFIGURED_ASMFLAGS}")

# Disable libstdc++/libc++ assertions, even in an LLVM_ENABLE_ASSERTIONS build,
# to avoid an unwanted dependency on libstdc++/libc++.so.
add_definitions(-U_GLIBCXX_ASSERTIONS)
add_definitions(-U_LIBCPP_ENABLE_ASSERTIONS)

# Remove any cmake-automatic linking of the standard C++ library.
# We neither need (nor want) the standard C++ library dependency even though we compile c++ files.
if(NOT ${LIBOMP_USE_STDCPPLIB})
Expand Down

0 comments on commit b1d69b7

Please sign in to comment.