Skip to content

Revert "Revert "[compiler-rt] Remove redundant COMPILER_RT_HAS_*SAN checks"" #98395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

vitalybuka
Copy link
Collaborator

Reverts #98380

Probably some incremental build issue, the build before revert was green:
https://lab.llvm.org/buildbot/#/builders/109/builds/817

@vitalybuka vitalybuka merged commit b96eb76 into main Jul 10, 2024
4 of 6 checks passed
@vitalybuka vitalybuka deleted the revert-98380-revert-98240-users/vitalybuka/spr/compiler-rt-remove-redundant-compiler_rt_has_san-checks branch July 10, 2024 21:35
@llvmbot llvmbot added compiler-rt compiler-rt:cfi Control Flow Integrity compiler-rt:ubsan Undefined behavior sanitizer compiler-rt:scudo Scudo Hardened Allocator xray compiler-rt:lsan Leak sanitizer compiler-rt:sanitizer labels Jul 10, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 10, 2024

@llvm/pr-subscribers-xray

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Vitaly Buka (vitalybuka)

Changes

Reverts llvm/llvm-project#98380

Probably some incremental build issue, the build before revert was green:
https://lab.llvm.org/buildbot/#/builders/109/builds/817


Patch is 31.63 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/98395.diff

14 Files Affected:

  • (modified) compiler-rt/lib/CMakeLists.txt (+2-2)
  • (modified) compiler-rt/lib/gwp_asan/CMakeLists.txt (+37-39)
  • (modified) compiler-rt/lib/lsan/CMakeLists.txt (+33-35)
  • (modified) compiler-rt/lib/nsan/CMakeLists.txt (+23-25)
  • (modified) compiler-rt/lib/scudo/standalone/CMakeLists.txt (+46-48)
  • (modified) compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt (+18-20)
  • (modified) compiler-rt/lib/ubsan/CMakeLists.txt (+104-108)
  • (modified) compiler-rt/lib/ubsan_minimal/CMakeLists.txt (+26-28)
  • (modified) compiler-rt/test/cfi/CMakeLists.txt (+1-3)
  • (modified) compiler-rt/test/gwp_asan/CMakeLists.txt (+2-2)
  • (modified) compiler-rt/test/orc/CMakeLists.txt (+1-1)
  • (modified) compiler-rt/test/rtsan/CMakeLists.txt (+11-13)
  • (modified) compiler-rt/test/scudo/standalone/CMakeLists.txt (+1-1)
  • (modified) compiler-rt/test/xray/CMakeLists.txt (+2-3)
diff --git a/compiler-rt/lib/CMakeLists.txt b/compiler-rt/lib/CMakeLists.txt
index f9e96563b8809..73a2ee46291ee 100644
--- a/compiler-rt/lib/CMakeLists.txt
+++ b/compiler-rt/lib/CMakeLists.txt
@@ -47,11 +47,11 @@ if(COMPILER_RT_BUILD_SANITIZERS)
   endforeach()
 endif()
 
-if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
+if(COMPILER_RT_BUILD_PROFILE)
   compiler_rt_build_runtime(profile)
 endif()
 
-if(COMPILER_RT_BUILD_CTX_PROFILE AND COMPILER_RT_HAS_CTX_PROFILE)
+if(COMPILER_RT_BUILD_CTX_PROFILE)
   compiler_rt_build_runtime(ctx_profile)
 endif()
 
diff --git a/compiler-rt/lib/gwp_asan/CMakeLists.txt b/compiler-rt/lib/gwp_asan/CMakeLists.txt
index bb5b2902f99db..fdb6a95fe1404 100644
--- a/compiler-rt/lib/gwp_asan/CMakeLists.txt
+++ b/compiler-rt/lib/gwp_asan/CMakeLists.txt
@@ -65,48 +65,46 @@ set(GWP_ASAN_SEGV_HANDLER_HEADERS
 set(GWP_ASAN_OPTIONS_PARSER_CFLAGS
     ${GWP_ASAN_CFLAGS})
 
-if (COMPILER_RT_HAS_GWP_ASAN)
-  foreach(arch ${GWP_ASAN_SUPPORTED_ARCH})
-    add_compiler_rt_runtime(
-      clang_rt.gwp_asan
-      STATIC
-      ARCHS ${arch}
-      SOURCES ${GWP_ASAN_SOURCES}
-      ADDITIONAL_HEADERS ${GWP_ASAN_HEADERS}
-      CFLAGS ${GWP_ASAN_CFLAGS}
-      PARENT_TARGET gwp_asan
-    )
-  endforeach()
+foreach(arch ${GWP_ASAN_SUPPORTED_ARCH})
+  add_compiler_rt_runtime(
+    clang_rt.gwp_asan
+    STATIC
+    ARCHS ${arch}
+    SOURCES ${GWP_ASAN_SOURCES}
+    ADDITIONAL_HEADERS ${GWP_ASAN_HEADERS}
+    CFLAGS ${GWP_ASAN_CFLAGS}
+    PARENT_TARGET gwp_asan
+  )
+endforeach()
 
-  add_compiler_rt_object_libraries(RTGwpAsan
-      ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
-      SOURCES ${GWP_ASAN_SOURCES}
-      ADDITIONAL_HEADERS ${GWP_ASAN_HEADERS}
-      CFLAGS ${GWP_ASAN_CFLAGS})
+add_compiler_rt_object_libraries(RTGwpAsan
+    ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
+    SOURCES ${GWP_ASAN_SOURCES}
+    ADDITIONAL_HEADERS ${GWP_ASAN_HEADERS}
+    CFLAGS ${GWP_ASAN_CFLAGS})
 
-  add_compiler_rt_object_libraries(RTGwpAsanOptionsParser
-      ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
-      SOURCES ${GWP_ASAN_OPTIONS_PARSER_SOURCES}
-      ADDITIONAL_HEADERS ${GWP_ASAN_OPTIONS_PARSER_HEADERS}
-      CFLAGS ${GWP_ASAN_OPTIONS_PARSER_CFLAGS})
+add_compiler_rt_object_libraries(RTGwpAsanOptionsParser
+    ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
+    SOURCES ${GWP_ASAN_OPTIONS_PARSER_SOURCES}
+    ADDITIONAL_HEADERS ${GWP_ASAN_OPTIONS_PARSER_HEADERS}
+    CFLAGS ${GWP_ASAN_OPTIONS_PARSER_CFLAGS})
 
-  # As above, build the pre-implemented optional backtrace support libraries.
-  add_compiler_rt_object_libraries(RTGwpAsanBacktraceLibc
-      ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
-      SOURCES optional/backtrace_linux_libc.cpp
-      ADDITIONAL_HEADERS ${GWP_ASAN_BACKTRACE_HEADERS}
-      CFLAGS ${GWP_ASAN_CFLAGS})
-  add_compiler_rt_object_libraries(RTGwpAsanSegvHandler
-      ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
-      SOURCES optional/segv_handler_posix.cpp
-      ADDITIONAL_HEADERS ${GWP_ASAN_SEGV_HANDLER_HEADERS}
-      CFLAGS ${GWP_ASAN_CFLAGS})
-  add_compiler_rt_object_libraries(RTGwpAsanBacktraceSanitizerCommon
-      ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
-      SOURCES optional/backtrace_sanitizer_common.cpp
-      ADDITIONAL_HEADERS ${GWP_ASAN_BACKTRACE_HEADERS}
-      CFLAGS ${GWP_ASAN_CFLAGS} ${SANITIZER_COMMON_CFLAGS})
-endif()
+# As above, build the pre-implemented optional backtrace support libraries.
+add_compiler_rt_object_libraries(RTGwpAsanBacktraceLibc
+    ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
+    SOURCES optional/backtrace_linux_libc.cpp
+    ADDITIONAL_HEADERS ${GWP_ASAN_BACKTRACE_HEADERS}
+    CFLAGS ${GWP_ASAN_CFLAGS})
+add_compiler_rt_object_libraries(RTGwpAsanSegvHandler
+    ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
+    SOURCES optional/segv_handler_posix.cpp
+    ADDITIONAL_HEADERS ${GWP_ASAN_SEGV_HANDLER_HEADERS}
+    CFLAGS ${GWP_ASAN_CFLAGS})
+add_compiler_rt_object_libraries(RTGwpAsanBacktraceSanitizerCommon
+    ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
+    SOURCES optional/backtrace_sanitizer_common.cpp
+    ADDITIONAL_HEADERS ${GWP_ASAN_BACKTRACE_HEADERS}
+    CFLAGS ${GWP_ASAN_CFLAGS} ${SANITIZER_COMMON_CFLAGS})
 
 if(COMPILER_RT_INCLUDE_TESTS)
   add_subdirectory(tests)
diff --git a/compiler-rt/lib/lsan/CMakeLists.txt b/compiler-rt/lib/lsan/CMakeLists.txt
index 8e9861cd6b7c0..c7bb6449982c2 100644
--- a/compiler-rt/lib/lsan/CMakeLists.txt
+++ b/compiler-rt/lib/lsan/CMakeLists.txt
@@ -43,46 +43,44 @@ add_compiler_rt_object_libraries(RTLSanCommon
     ADDITIONAL_HEADERS ${LSAN_HEADERS}
     CFLAGS ${LSAN_CFLAGS})
 
-if(COMPILER_RT_HAS_LSAN)
-  add_compiler_rt_component(lsan)
-  if(APPLE)
-    set(LSAN_LINK_LIBS ${SANITIZER_COMMON_LINK_LIBS})
+add_compiler_rt_component(lsan)
+if(APPLE)
+  set(LSAN_LINK_LIBS ${SANITIZER_COMMON_LINK_LIBS})
 
-    add_weak_symbols("lsan" WEAK_SYMBOL_LINK_FLAGS)
-    add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS)
+  add_weak_symbols("lsan" WEAK_SYMBOL_LINK_FLAGS)
+  add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS)
 
+  add_compiler_rt_runtime(clang_rt.lsan
+    SHARED
+    OS ${LSAN_SUPPORTED_OS}
+    ARCHS ${LSAN_SUPPORTED_ARCH}
+    SOURCES ${LSAN_SOURCES}
+    ADDITIONAL_HEADERS ${LSAN_HEADERS}
+    OBJECT_LIBS RTLSanCommon
+                RTInterception
+                RTSanitizerCommon
+                RTSanitizerCommonLibc
+                RTSanitizerCommonCoverage
+                RTSanitizerCommonSymbolizer
+    CFLAGS ${LSAN_CFLAGS}
+    LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} ${WEAK_SYMBOL_LINK_FLAGS}
+    LINK_LIBS ${LSAN_LINK_LIBS}
+    PARENT_TARGET lsan)
+else()
+  foreach(arch ${LSAN_SUPPORTED_ARCH})
     add_compiler_rt_runtime(clang_rt.lsan
-      SHARED
-      OS ${LSAN_SUPPORTED_OS}
-      ARCHS ${LSAN_SUPPORTED_ARCH}
+      STATIC
+      ARCHS ${arch}
       SOURCES ${LSAN_SOURCES}
+              $<TARGET_OBJECTS:RTInterception.${arch}>
+              $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
+              $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
+              $<TARGET_OBJECTS:RTSanitizerCommonCoverage.${arch}>
+              $<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>
+              $<TARGET_OBJECTS:RTSanitizerCommonSymbolizerInternal.${arch}>
+              $<TARGET_OBJECTS:RTLSanCommon.${arch}>
       ADDITIONAL_HEADERS ${LSAN_HEADERS}
-      OBJECT_LIBS RTLSanCommon
-                  RTInterception
-                  RTSanitizerCommon
-                  RTSanitizerCommonLibc
-                  RTSanitizerCommonCoverage
-                  RTSanitizerCommonSymbolizer
       CFLAGS ${LSAN_CFLAGS}
-      LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} ${WEAK_SYMBOL_LINK_FLAGS}
-      LINK_LIBS ${LSAN_LINK_LIBS}
       PARENT_TARGET lsan)
-  else()
-    foreach(arch ${LSAN_SUPPORTED_ARCH})
-      add_compiler_rt_runtime(clang_rt.lsan
-        STATIC
-        ARCHS ${arch}
-        SOURCES ${LSAN_SOURCES}
-                $<TARGET_OBJECTS:RTInterception.${arch}>
-                $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
-                $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
-                $<TARGET_OBJECTS:RTSanitizerCommonCoverage.${arch}>
-                $<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>
-                $<TARGET_OBJECTS:RTSanitizerCommonSymbolizerInternal.${arch}>
-                $<TARGET_OBJECTS:RTLSanCommon.${arch}>
-        ADDITIONAL_HEADERS ${LSAN_HEADERS}
-        CFLAGS ${LSAN_CFLAGS}
-        PARENT_TARGET lsan)
-    endforeach()
-  endif()
+  endforeach()
 endif()
diff --git a/compiler-rt/lib/nsan/CMakeLists.txt b/compiler-rt/lib/nsan/CMakeLists.txt
index 36c7b2b9dfada..aef9b651ab2ec 100644
--- a/compiler-rt/lib/nsan/CMakeLists.txt
+++ b/compiler-rt/lib/nsan/CMakeLists.txt
@@ -25,31 +25,29 @@ set(NSAN_DYNAMIC_LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS})
 
 set(NSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 
-if (COMPILER_RT_HAS_NSAN)
-  foreach(arch ${NSAN_SUPPORTED_ARCH})
-    add_compiler_rt_runtime(
-      clang_rt.nsan
-      STATIC
-      ARCHS ${arch}
-      SOURCES ${NSAN_SOURCES}
-              $<TARGET_OBJECTS:RTInterception.${arch}>
-              $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
-              $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
-              $<TARGET_OBJECTS:RTSanitizerCommonCoverage.${arch}>
-              $<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>
-              $<TARGET_OBJECTS:RTUbsan.${arch}>
-      ADDITIONAL_HEADERS ${NSAN_HEADERS}
-      CFLAGS ${NSAN_CFLAGS}
-      PARENT_TARGET nsan
-    )
-  endforeach()
-
-  add_compiler_rt_object_libraries(RTNsan
-      ARCHS ${NSAN_SUPPORTED_ARCH}
-      SOURCES ${NSAN_SOURCES}
-      ADDITIONAL_HEADERS ${NSAN_HEADERS}
-      CFLAGS ${NSAN_CFLAGS})
-endif()
+foreach(arch ${NSAN_SUPPORTED_ARCH})
+  add_compiler_rt_runtime(
+    clang_rt.nsan
+    STATIC
+    ARCHS ${arch}
+    SOURCES ${NSAN_SOURCES}
+            $<TARGET_OBJECTS:RTInterception.${arch}>
+            $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
+            $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
+            $<TARGET_OBJECTS:RTSanitizerCommonCoverage.${arch}>
+            $<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>
+            $<TARGET_OBJECTS:RTUbsan.${arch}>
+    ADDITIONAL_HEADERS ${NSAN_HEADERS}
+    CFLAGS ${NSAN_CFLAGS}
+    PARENT_TARGET nsan
+  )
+endforeach()
+
+add_compiler_rt_object_libraries(RTNsan
+    ARCHS ${NSAN_SUPPORTED_ARCH}
+    SOURCES ${NSAN_SOURCES}
+    ADDITIONAL_HEADERS ${NSAN_HEADERS}
+    CFLAGS ${NSAN_CFLAGS})
 
 if(COMPILER_RT_INCLUDE_TESTS)
   add_subdirectory(tests)
diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt
index 6fb4e88de3155..8fc245eb2cf38 100644
--- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt
+++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt
@@ -195,60 +195,58 @@ if(COMPILER_RT_DEFAULT_TARGET_ARCH MATCHES "mips|mips64|mipsel|mips64el")
   list(APPEND SCUDO_LINK_LIBS atomic)
 endif()
 
-if(COMPILER_RT_HAS_SCUDO_STANDALONE)
-  add_compiler_rt_object_libraries(RTScudoStandalone
-    ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
-    SOURCES ${SCUDO_SOURCES}
-    ADDITIONAL_HEADERS ${SCUDO_HEADERS}
-    CFLAGS ${SCUDO_CFLAGS}
-    DEPS ${SCUDO_DEPS})
-  add_compiler_rt_object_libraries(RTScudoStandaloneCWrappers
-    ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
-    SOURCES ${SCUDO_SOURCES_C_WRAPPERS}
-    ADDITIONAL_HEADERS ${SCUDO_HEADERS}
-    CFLAGS ${SCUDO_CFLAGS}
-    DEPS ${SCUDO_DEPS})
-  add_compiler_rt_object_libraries(RTScudoStandaloneCxxWrappers
-    ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
-    SOURCES ${SCUDO_SOURCES_CXX_WRAPPERS}
-    ADDITIONAL_HEADERS ${SCUDO_HEADERS}
-    CFLAGS ${SCUDO_CFLAGS}
-    DEPS ${SCUDO_DEPS})
-
+add_compiler_rt_object_libraries(RTScudoStandalone
+  ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
+  SOURCES ${SCUDO_SOURCES}
+  ADDITIONAL_HEADERS ${SCUDO_HEADERS}
+  CFLAGS ${SCUDO_CFLAGS}
+  DEPS ${SCUDO_DEPS})
+add_compiler_rt_object_libraries(RTScudoStandaloneCWrappers
+  ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
+  SOURCES ${SCUDO_SOURCES_C_WRAPPERS}
+  ADDITIONAL_HEADERS ${SCUDO_HEADERS}
+  CFLAGS ${SCUDO_CFLAGS}
+  DEPS ${SCUDO_DEPS})
+add_compiler_rt_object_libraries(RTScudoStandaloneCxxWrappers
+  ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
+  SOURCES ${SCUDO_SOURCES_CXX_WRAPPERS}
+  ADDITIONAL_HEADERS ${SCUDO_HEADERS}
+  CFLAGS ${SCUDO_CFLAGS}
+  DEPS ${SCUDO_DEPS})
+
+add_compiler_rt_runtime(clang_rt.scudo_standalone
+  STATIC
+  ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
+  SOURCES ${SCUDO_SOURCES} ${SCUDO_SOURCES_C_WRAPPERS}
+  ADDITIONAL_HEADERS ${SCUDO_HEADERS}
+  CFLAGS ${SCUDO_CFLAGS}
+  DEPS ${SCUDO_DEPS}
+  OBJECT_LIBS ${SCUDO_OBJECT_LIBS}
+  PARENT_TARGET scudo_standalone)
+add_compiler_rt_runtime(clang_rt.scudo_standalone_cxx
+  STATIC
+  ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
+  SOURCES ${SCUDO_SOURCES_CXX_WRAPPERS}
+  ADDITIONAL_HEADERS ${SCUDO_HEADERS}
+  CFLAGS ${SCUDO_CFLAGS}
+  DEPS ${SCUDO_DEPS}
+  PARENT_TARGET scudo_standalone)
+
+if(COMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED)
   add_compiler_rt_runtime(clang_rt.scudo_standalone
-    STATIC
+    SHARED
     ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
-    SOURCES ${SCUDO_SOURCES} ${SCUDO_SOURCES_C_WRAPPERS}
+    SOURCES ${SCUDO_SOURCES} ${SCUDO_SOURCES_C_WRAPPERS} ${SCUDO_SOURCES_CXX_WRAPPERS}
     ADDITIONAL_HEADERS ${SCUDO_HEADERS}
     CFLAGS ${SCUDO_CFLAGS}
     DEPS ${SCUDO_DEPS}
     OBJECT_LIBS ${SCUDO_OBJECT_LIBS}
+    LINK_FLAGS ${SCUDO_LINK_FLAGS}
+    LINK_LIBS ${SCUDO_LINK_LIBS}
     PARENT_TARGET scudo_standalone)
-  add_compiler_rt_runtime(clang_rt.scudo_standalone_cxx
-    STATIC
-    ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
-    SOURCES ${SCUDO_SOURCES_CXX_WRAPPERS}
-    ADDITIONAL_HEADERS ${SCUDO_HEADERS}
-    CFLAGS ${SCUDO_CFLAGS}
-    DEPS ${SCUDO_DEPS}
-    PARENT_TARGET scudo_standalone)
-
-  if(COMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED)
-    add_compiler_rt_runtime(clang_rt.scudo_standalone
-      SHARED
-      ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
-      SOURCES ${SCUDO_SOURCES} ${SCUDO_SOURCES_C_WRAPPERS} ${SCUDO_SOURCES_CXX_WRAPPERS}
-      ADDITIONAL_HEADERS ${SCUDO_HEADERS}
-      CFLAGS ${SCUDO_CFLAGS}
-      DEPS ${SCUDO_DEPS}
-      OBJECT_LIBS ${SCUDO_OBJECT_LIBS}
-      LINK_FLAGS ${SCUDO_LINK_FLAGS}
-      LINK_LIBS ${SCUDO_LINK_LIBS}
-      PARENT_TARGET scudo_standalone)
-  endif()
+endif()
 
-  add_subdirectory(benchmarks)
-  if(COMPILER_RT_INCLUDE_TESTS)
-    add_subdirectory(tests)
-  endif()
+add_subdirectory(benchmarks)
+if(COMPILER_RT_INCLUDE_TESTS)
+  add_subdirectory(tests)
 endif()
diff --git a/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
index 1786756fa5ea6..672cdc0ba655e 100644
--- a/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
+++ b/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
@@ -66,27 +66,25 @@ macro(add_scudo_unittest testname)
          RTGwpAsan RTGwpAsanBacktraceLibc RTGwpAsanSegvHandler)
   endif()
 
-  if(COMPILER_RT_HAS_SCUDO_STANDALONE)
-    foreach(arch ${SCUDO_TEST_ARCH})
-      # Additional runtime objects get added along RTScudoStandalone
-      set(SCUDO_TEST_RTOBJECTS $<TARGET_OBJECTS:RTScudoStandalone.${arch}>)
-      foreach(rtobject ${TEST_ADDITIONAL_RTOBJECTS})
-        list(APPEND SCUDO_TEST_RTOBJECTS $<TARGET_OBJECTS:${rtobject}.${arch}>)
-      endforeach()
-      # Add the static runtime library made of all the runtime objects
-      set(RUNTIME RT${testname}.${arch})
-      add_library(${RUNTIME} STATIC ${SCUDO_TEST_RTOBJECTS})
-      set(ScudoUnitTestsObjects)
-      generate_compiler_rt_tests(ScudoUnitTestsObjects ScudoUnitTests
-        "${testname}-${arch}-Test" ${arch}
-        SOURCES ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}
-        COMPILE_DEPS ${SCUDO_TEST_HEADERS}
-        DEPS scudo_standalone
-        RUNTIME ${RUNTIME}
-        CFLAGS ${SCUDO_UNITTEST_CFLAGS}
-        LINK_FLAGS ${SCUDO_UNITTEST_LINK_FLAGS})
+  foreach(arch ${SCUDO_TEST_ARCH})
+    # Additional runtime objects get added along RTScudoStandalone
+    set(SCUDO_TEST_RTOBJECTS $<TARGET_OBJECTS:RTScudoStandalone.${arch}>)
+    foreach(rtobject ${TEST_ADDITIONAL_RTOBJECTS})
+      list(APPEND SCUDO_TEST_RTOBJECTS $<TARGET_OBJECTS:${rtobject}.${arch}>)
     endforeach()
-  endif()
+    # Add the static runtime library made of all the runtime objects
+    set(RUNTIME RT${testname}.${arch})
+    add_library(${RUNTIME} STATIC ${SCUDO_TEST_RTOBJECTS})
+    set(ScudoUnitTestsObjects)
+    generate_compiler_rt_tests(ScudoUnitTestsObjects ScudoUnitTests
+      "${testname}-${arch}-Test" ${arch}
+      SOURCES ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}
+      COMPILE_DEPS ${SCUDO_TEST_HEADERS}
+      DEPS scudo_standalone
+      RUNTIME ${RUNTIME}
+      CFLAGS ${SCUDO_UNITTEST_CFLAGS}
+      LINK_FLAGS ${SCUDO_UNITTEST_LINK_FLAGS})
+  endforeach()
 endmacro()
 
 set(SCUDO_UNIT_TEST_SOURCES
diff --git a/compiler-rt/lib/ubsan/CMakeLists.txt b/compiler-rt/lib/ubsan/CMakeLists.txt
index db0b33f1276ef..a1cfbe93b068d 100644
--- a/compiler-rt/lib/ubsan/CMakeLists.txt
+++ b/compiler-rt/lib/ubsan/CMakeLists.txt
@@ -92,47 +92,45 @@ if(APPLE)
     ADDITIONAL_HEADERS ${UBSAN_HEADERS}
     CFLAGS ${UBSAN_CXXFLAGS})
 
-  if(COMPILER_RT_HAS_UBSAN)
-    # Initializer of standalone UBSan runtime.
-    add_compiler_rt_object_libraries(RTUbsan_standalone
-      OS ${UBSAN_SUPPORTED_OS}
-      ARCHS ${UBSAN_SUPPORTED_ARCH}
-      SOURCES ${UBSAN_STANDALONE_SOURCES}
-      ADDITIONAL_HEADERS ${UBSAN_HEADERS}
-      CFLAGS ${UBSAN_STANDALONE_CFLAGS})
+  # Initializer of standalone UBSan runtime.
+  add_compiler_rt_object_libraries(RTUbsan_standalone
+    OS ${UBSAN_SUPPORTED_OS}
+    ARCHS ${UBSAN_SUPPORTED_ARCH}
+    SOURCES ${UBSAN_STANDALONE_SOURCES}
+    ADDITIONAL_HEADERS ${UBSAN_HEADERS}
+    CFLAGS ${UBSAN_STANDALONE_CFLAGS})
+
+  add_weak_symbols("ubsan" WEAK_SYMBOL_LINK_FLAGS)
+  add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS)
 
-    add_weak_symbols("ubsan" WEAK_SYMBOL_LINK_FLAGS)
-    add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS)
+  add_compiler_rt_runtime(clang_rt.ubsan
+    SHARED
+    OS ${UBSAN_SUPPORTED_OS}
+    ARCHS ${UBSAN_SUPPORTED_ARCH}
+    OBJECT_LIBS RTUbsan
+                RTUbsan_standalone
+                RTSanitizerCommon
+                RTSanitizerCommonLibc
+                RTSanitizerCommonCoverage
+                RTSanitizerCommonSymbolizer
+                RTInterception
+    LINK_FLAGS ${WEAK_SYMBOL_LINK_FLAGS}
+    PARENT_TARGET ubsan)
 
+  if (NOT APPLE)
     add_compiler_rt_runtime(clang_rt.ubsan
-      SHARED
+      STATIC
       OS ${UBSAN_SUPPORTED_OS}
       ARCHS ${UBSAN_SUPPORTED_ARCH}
       OBJECT_LIBS RTUbsan
                   RTUbsan_standalone
-                  RTSanitizerCommon
-                  RTSanitizerCommonLibc
+                  RTSanitizerCommonNoHooks
+                  RTSanitizerCommonLibcNoHooks
                   RTSanitizerCommonCoverage
-                  RTSanitizerCommonSymbolizer
+                  RTSanitizerCommonSymbolizerNoHooks
                   RTInterception
       LINK_FLAGS ${WEAK_SYMBOL_LINK_FLAGS}
       PARENT_TARGET ubsan)
-
-    if (NOT APPLE)
-      add_compiler_rt_runtime(clang_rt.ubsan
-        STATIC
-        OS ${UBSAN_SUPPORTED_OS}
-        ARCHS ${UBSAN_SUPPORTED_ARCH}
-        OBJECT_LIBS RTUbsan
-                    RTUbsan_standalone
-                    RTSanitizerCommonNoHooks
-                    RTSanitizerCommonLibcNoHooks
-                    RTSanitizerCommonCoverage
-                    RTSanitizerCommonSymbolizerNoHooks
-                    RTInterception
-        LINK_FLAGS ${WEAK_SYMBOL_LINK_FLAGS}
-        PARENT_TARGET ubsan)
-    endif()
   endif()
 
 else()
@@ -190,91 +188,89 @@ else()
       DEFS ${UBSAN_COMMON_DEFINITIONS})
   endif()
 
-  if(COMPILER_RT_HAS_UBSAN)
-    add_compiler_rt_object_libraries(RTUbsan_standalone
-      ARCHS ${UBSAN_SUPPORTED_ARCH}
-      SOURCES ${UBSAN_STANDALONE_SOURCES}
-      ADDITIONAL_HEADERS ${UBSAN_HEADERS}
-      CFLAGS ${UBSAN_STANDALONE_CFLAGS})
-
-    # Standalone UBSan runtimes.
-    add_compiler_rt_runtime(clang_rt.ubsan_standalone
-      STATIC
+  add_compiler_rt_object_libraries(RTUbsan_standalone
+    ARCHS ${UBSAN_SUPPORTED_ARCH}
+    SOURCES ${UBSAN_STANDALONE_SOURCES}
+    ADDITIONAL_HEADERS ${UBSAN_HEADERS}
+    CFLAGS ${UBSAN_STANDALONE_CFLAGS})
+
+  # Standalone UBSan runtimes.
+  add_compiler_rt_runtime(clang_rt.ubsan_standalone
+    STATIC
+    ARCHS ${UBSAN_SUPPORTED_ARCH}
+    SOURCES
+      ubsan_init_standalone_preinit.cpp
+    ADDITIONAL_HEADERS ${UBSAN_HEADERS}
+    OBJECT_LIBS RTSanitizerCommon
+            RTSanitizerCommonLibc
+            RTSanitizerCommonCoverage
+            RTSanitizerCommonSymbolizer
+            RTSanitizerCommonSymbolizerInternal
+            RTUbsan
+            RTUbsan_standalone
+            RTInterception
+    CFLAGS ${UBSAN_CFLAGS}
+    PARENT_TARGET ubsan)
+
+  add_compiler_rt_runtime(clang_rt.ubsan_standalone_cxx
+    STATIC
+    ARCHS ${UBSAN_SUPPORTED_ARCH}
+    OBJECT_LIBS RTUbsan_cxx
+    CFLAGS ${UBSAN_CXXFLAGS}
+    PARENT_TARGET ubsan)
+
+  if (COMPILER_RT_HAS_VERSION_SCRIPT)
+    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "")
+    add_compiler_rt_object_libraries(RTUbsan_dynamic_version_script_dummy
       ARCHS ${UBSAN_SUPPORTED_ARCH}
-      SOURCES
-        ubsan_init_standalone_preinit.cpp
-      ADDITIONAL_HEADERS ${UBSAN_HEADERS}
-      OBJECT_LIBS RTSanitizerCommon
+      SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp
+      CFLAGS ${...
[truncated]

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 10, 2024

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-runtime running on omp-vega20-0 while building compiler-rt at step 7 "Add check check-offload".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/30/builds/1704

Here is the relevant piece of the build log for the reference:

Step 7 (Add check check-offload) failure: test (failure)
...
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/test_libc.cpp (777 of 786)
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/bug50022.cpp (778 of 786)
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/wtime.c (779 of 786)
PASS: libomptarget :: x86_64-pc-linux-gnu :: offloading/bug49021.cpp (780 of 786)
PASS: libomptarget :: x86_64-pc-linux-gnu :: offloading/std_complex_arithmetic.cpp (781 of 786)
PASS: libomptarget :: amdgcn-amd-amdhsa :: offloading/bug49021.cpp (782 of 786)
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/complex_reduction.cpp (783 of 786)
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/bug49021.cpp (784 of 786)
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/std_complex_arithmetic.cpp (785 of 786)
TIMEOUT: libomptarget :: amdgcn-amd-amdhsa :: offloading/ctor_dtor.cpp (786 of 786)
******************** TEST 'libomptarget :: amdgcn-amd-amdhsa :: offloading/ctor_dtor.cpp' FAILED ********************
Exit Code: -9
Timeout: Reached timeout of 100 seconds

Command Output (stdout):
--
# RUN: at line 1
/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./bin/clang++ -fopenmp    -I /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib  -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test/offloading/ctor_dtor.cpp -o /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/ctor_dtor.cpp.tmp /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a && /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/ctor_dtor.cpp.tmp | /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test/offloading/ctor_dtor.cpp
# executed command: /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./bin/clang++ -fopenmp -I /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test/offloading/ctor_dtor.cpp -o /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/ctor_dtor.cpp.tmp /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a
# note: command had no output on stdout or stderr
# executed command: /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/ctor_dtor.cpp.tmp
# note: command had no output on stdout or stderr
# error: command failed with exit status: -9
# error: command reached timeout: True
# executed command: /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test/offloading/ctor_dtor.cpp
# note: command had no output on stdout or stderr
# error: command failed with exit status: -9
# error: command reached timeout: True

--

********************
Slowest Tests:
--------------------------------------------------------------------------
100.04s: libomptarget :: amdgcn-amd-amdhsa :: offloading/ctor_dtor.cpp
16.51s: libomptarget :: amdgcn-amd-amdhsa :: offloading/bug49021.cpp
13.35s: libomptarget :: amdgcn-amd-amdhsa :: offloading/parallel_target_teams_reduction_min.cpp
12.86s: libomptarget :: amdgcn-amd-amdhsa :: offloading/parallel_target_teams_reduction_max.cpp
11.72s: libomptarget :: amdgcn-amd-amdhsa :: offloading/complex_reduction.cpp
9.80s: libomptarget :: x86_64-pc-linux-gnu :: offloading/bug49021.cpp
9.35s: libomptarget :: amdgcn-amd-amdhsa :: jit/empty_kernel_lvl2.c
8.01s: libomptarget :: x86_64-pc-linux-gnu :: offloading/complex_reduction.cpp
7.99s: libomptarget :: x86_64-pc-linux-gnu :: offloading/std_complex_arithmetic.cpp
7.87s: libomptarget :: amdgcn-amd-amdhsa :: offloading/ompx_saxpy_mixed.c
7.47s: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/bug49021.cpp
6.50s: libomptarget :: amdgcn-amd-amdhsa :: offloading/barrier_fence.c
6.00s: libomptarget :: amdgcn-amd-amdhsa :: offloading/parallel_target_teams_reduction.cpp
5.49s: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/std_complex_arithmetic.cpp
5.47s: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/complex_reduction.cpp

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 10, 2024

LLVM Buildbot has detected a new failure on builder clang-ppc64le-linux-test-suite running on ppc64le-clang-test-suite while building compiler-rt at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/95/builds/1099

Here is the relevant piece of the build log for the reference:

Step 5 (build-unified-tree) failure: build (failure)
...
CMake Error at /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/llvm/cmake/modules/AddLLVM.cmake:2041 (add_dependencies):
  The dependency target "cfi" of target "check-cfi-and-supported" does not
  exist.
Call Stack (most recent call first):
  /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/cfi/CMakeLists.txt:92 (add_lit_target)


-- Generating done (0.2s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
299.715 [3/2/5766] Linking CXX executable bin/c-index-test
FAILED: runtimes/runtimes-stamps/runtimes-configure /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-stamps/runtimes-configure 
cd /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins && /home/buildbots/llvm-external-buildbots/cmake-3.28.2/bin/cmake --no-warn-unused-cli -DCMAKE_C_COMPILER=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/clang -DCMAKE_CXX_COMPILER=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/clang++ -DCMAKE_ASM_COMPILER=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/clang -DCMAKE_AR=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/llvm-ar -DCMAKE_RANLIB=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/llvm-ranlib -DCMAKE_NM=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/llvm-nm -DCMAKE_OBJDUMP=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/llvm-objdump -DCMAKE_OBJCOPY=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/llvm-objcopy -DCMAKE_STRIP=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/llvm-strip -DCMAKE_READELF=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/llvm-readelf -DCMAKE_C_COMPILER_TARGET=powerpc64le-unknown-linux-gnu -DCMAKE_CXX_COMPILER_TARGET=powerpc64le-unknown-linux-gnu -DCMAKE_ASM_COMPILER_TARGET=powerpc64le-unknown-linux-gnu -DCMAKE_INSTALL_PREFIX=/usr/local -DLLVM_BINARY_DIR=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build -DLLVM_CONFIG_PATH=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/bin/llvm-config -DLLVM_ENABLE_WERROR=OFF -DLLVM_HOST_TRIPLE=powerpc64le-unknown-linux-gnu -DLLVM_HAVE_LINK_VERSION_SCRIPT=1 -DLLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO=OFF -DLLVM_USE_RELATIVE_PATHS_IN_FILES=OFF -DLLVM_LIT_ARGS=-v -DLLVM_SOURCE_PREFIX= -DPACKAGE_VERSION=19.0.0git -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja-build -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=ON -DLLVM_DEFAULT_TARGET_TRIPLE=powerpc64le-unknown-linux-gnu -DLLVM_ENABLE_PROJECTS_USED=ON -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_BUILD_TOOLS=ON -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON -DHAVE_LLVM_LIT=ON -DCLANG_RESOURCE_DIR= -DLLVM_ENABLE_RUNTIMES=compiler-rt -GNinja -S /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/llvm/runtimes/../../runtimes -B /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins && /home/buildbots/llvm-external-buildbots/cmake-3.28.2/bin/cmake -E touch /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-stamps/runtimes-configure
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 10, 2024

LLVM Buildbot has detected a new failure on builder sanitizer-windows running on sanitizer-windows while building compiler-rt at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/107/builds/844

Here is the relevant piece of the build log for the reference:

Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/sanitizer-windows.py ...' (failure)
...
  Using std::regex with exceptions disabled is not fully supported


-- Configuring done (10.1s)
-- Generating done (12.5s)
-- Build files have been written to: C:/b/slave/sanitizer-windows/build/stage1
@@@BUILD_STEP stage 1 build@@@
@@@HALT_ON_FAILURE@@@
Running: ninja -j 16 compiler-rt
[1/13] Building CXX object projects\compiler-rt\lib\lsan\CMakeFiles\clang_rt.lsan-x86_64.dir\lsan_thread.cpp.obj
FAILED: projects/compiler-rt/lib/lsan/CMakeFiles/clang_rt.lsan-x86_64.dir/lsan_thread.cpp.obj 
C:\PROGRA~2\MIB055~1\2019\PROFES~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\cl.exe  /nologo /TP -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\lib\lsan -IC:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan -IC:\b\slave\sanitizer-windows\build\stage1\include -IC:\b\slave\sanitizer-windows\llvm-project\llvm\include -IC:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\.. /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Z7 /Oi /bigobj /permissive- -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /W4 /O2 /Ob2  -std:c++17 -MT /Oy- /GS- /Zc:threadSafeInit- /Z7 /wd4146 /wd4291 /wd4391 /wd4722 /wd4800 /GR- /showIncludes /Foprojects\compiler-rt\lib\lsan\CMakeFiles\clang_rt.lsan-x86_64.dir\lsan_thread.cpp.obj /Fdprojects\compiler-rt\lib\lsan\CMakeFiles\clang_rt.lsan-x86_64.dir\clang_rt.lsan-x86_64.pdb /FS -c C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_thread.cpp
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_thread.cpp(34): error C2027: use of undefined type '__lsan::ThreadContext'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_thread.h(45): note: see declaration of '__lsan::ThreadContext'
[2/13] Building CXX object projects\compiler-rt\lib\lsan\CMakeFiles\clang_rt.lsan-x86_64.dir\lsan_interceptors.cpp.obj
FAILED: projects/compiler-rt/lib/lsan/CMakeFiles/clang_rt.lsan-x86_64.dir/lsan_interceptors.cpp.obj 
C:\PROGRA~2\MIB055~1\2019\PROFES~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\cl.exe  /nologo /TP -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\lib\lsan -IC:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan -IC:\b\slave\sanitizer-windows\build\stage1\include -IC:\b\slave\sanitizer-windows\llvm-project\llvm\include -IC:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\.. /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Z7 /Oi /bigobj /permissive- -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /W4 /O2 /Ob2  -std:c++17 -MT /Oy- /GS- /Zc:threadSafeInit- /Z7 /wd4146 /wd4291 /wd4391 /wd4722 /wd4800 /GR- /showIncludes /Foprojects\compiler-rt\lib\lsan\CMakeFiles\clang_rt.lsan-x86_64.dir\lsan_interceptors.cpp.obj /Fdprojects\compiler-rt\lib\lsan\CMakeFiles\clang_rt.lsan-x86_64.dir\clang_rt.lsan-x86_64.pdb /FS -c C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(248): error C2375: 'operator new': redefinition; different linkage
predefined C++ types (compiler internal)(33): note: see declaration of 'operator new'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(250): error C2375: 'operator new[]': redefinition; different linkage
predefined C++ types (compiler internal)(58): note: see declaration of 'operator new[]'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(258): error C2375: 'operator new': redefinition; different linkage
predefined C++ types (compiler internal)(36): note: see declaration of 'operator new'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(261): error C2375: 'operator new[]': redefinition; different linkage
predefined C++ types (compiler internal)(61): note: see declaration of 'operator new[]'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(271): error C2375: 'operator delete': redefinition; different linkage
predefined C++ types (compiler internal)(34): note: see declaration of 'operator delete'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(273): error C2375: 'operator delete[]': redefinition; different linkage
predefined C++ types (compiler internal)(59): note: see declaration of 'operator delete[]'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(280): error C2375: 'operator delete': redefinition; different linkage
predefined C++ types (compiler internal)(44): note: see declaration of 'operator delete'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(283): error C2375: 'operator delete[]': redefinition; different linkage
predefined C++ types (compiler internal)(67): note: see declaration of 'operator delete[]'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(286): error C2375: 'operator delete': redefinition; different linkage
predefined C++ types (compiler internal)(37): note: see declaration of 'operator delete'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(289): error C2375: 'operator delete[]': redefinition; different linkage
predefined C++ types (compiler internal)(62): note: see declaration of 'operator delete[]'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(298): error C2375: 'operator delete': redefinition; different linkage
predefined C++ types (compiler internal)(50): note: see declaration of 'operator delete'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(301): error C2375: 'operator delete[]': redefinition; different linkage
predefined C++ types (compiler internal)(71): note: see declaration of 'operator delete[]'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(547): error C3861: 'InitializeSignalInterceptors': identifier not found
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(563): error C2065: 'pthread_create': undeclared identifier
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(563): error C2065: '__asan_wrap_pthread_create': undeclared identifier
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(563): error C2039: 'real_pthread_create': is not a member of '__interception'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(157): note: see declaration of '__interception'
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(563): error C2065: 'real_pthread_create': undeclared identifier
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(564): error C2065: 'pthread_join': undeclared identifier
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\lsan\lsan_interceptors.cpp(564): error C2065: '__asan_wrap_pthread_join': undeclared identifier

vitalybuka added a commit that referenced this pull request Jul 11, 2024
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler-rt:cfi Control Flow Integrity compiler-rt:lsan Leak sanitizer compiler-rt:sanitizer compiler-rt:scudo Scudo Hardened Allocator compiler-rt:ubsan Undefined behavior sanitizer compiler-rt xray
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants