From b1d69b7f9f07462a7ef38c6de7811f1ce11d6a11 Mon Sep 17 00:00:00 2001 From: Kareem Ergawy Date: Mon, 15 Jan 2024 16:40:32 +0100 Subject: [PATCH] [OpenMP] Remove unwanted dependency on libstdc++ for libomp (#258) 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: https://github.com/llvm/llvm-project/pull/73249 --- openmp/runtime/src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt index 619d4f7ba458..46139f3a6478 100644 --- a/openmp/runtime/src/CMakeLists.txt +++ b/openmp/runtime/src/CMakeLists.txt @@ -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})