From 74e9bc6cb93964edfcb3761623a43d1e55aceb2a Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 6 Feb 2026 08:17:56 +0800 Subject: [PATCH] openmp: add atomic to SANITIZER_COMMON_LINK_LIBS for MIPS (#179933) atomic is needed explicitly for MIPS. --- openmp/runtime/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openmp/runtime/CMakeLists.txt b/openmp/runtime/CMakeLists.txt index 9332ca30128d..dc2f2be079bf 100644 --- a/openmp/runtime/CMakeLists.txt +++ b/openmp/runtime/CMakeLists.txt @@ -152,6 +152,10 @@ else() "Appended user specified linked libs flags. (e.g., -lm)") endif() +if("${LIBOMP_ARCH}" STREQUAL "mips" OR "${LIBOMP_ARCH}" STREQUAL "mips64") + set(LIBOMP_LIBFLAGS "${LIBOMP_LIBFLAGS} -latomic") +endif() + # Should the libomp library and generated headers be copied into the original source exports/ directory # Turning this to FALSE aids parallel builds to not interfere with each other. # Currently, the testsuite module expects the just built OpenMP library to be located inside the exports/