0029-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 711f43f7cec85e5c21f4a76c65695a838d84c1fa Mon Sep 17 00:00:00 2001
  2. From: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  3. Date: Fri, 22 Oct 2021 12:09:32 +0800
  4. Subject: [PATCH] compiler-rt: Link scudo standalone with libatomic on mips
  5. clang on mips generate atomic built-ins which should be provided by
  6. libatomic
  7. Upstream-Status: Pending
  8. Rebased to LLVM 14.0.0 by Jun Yuan Tan
  9. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  10. Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  11. ---
  12. compiler-rt/lib/scudo/standalone/CMakeLists.txt | 4 ++++
  13. 1 file changed, 4 insertions(+)
  14. diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt
  15. index 739f131bdefd..5862545b842b 100644
  16. --- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt
  17. +++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt
  18. @@ -137,6 +137,10 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread SCUDO_LINK_FLAGS)
  19. append_list_if(FUCHSIA zircon SCUDO_LINK_LIBS)
  20. +if (CMAKE_SYSTEM_PROCESSOR MATCHES "mips" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
  21. + list(APPEND SCUDO_LINK_LIBS atomic)
  22. +endif()
  23. +
  24. if(COMPILER_RT_HAS_SCUDO_STANDALONE)
  25. add_compiler_rt_object_libraries(RTScudoStandalone
  26. ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
  27. --
  28. 2.33.0