Skip to content

Commit

Permalink
[OpenMP] Remove unwanted dependency on libstdc++ for libomp
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 llvm#73248

Note: Applies upstream diff: llvm#73249
  • Loading branch information
ergawy committed Jan 15, 2024
1 parent 1657ee7 commit e43e8b5
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 e43e8b5

Please sign in to comment.