0029-lldb-Link-with-libatomic-on-x86.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. From e9c06e4994d4cd52d8783838186df8c93ffd0052 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Tue, 8 Feb 2022 01:31:26 -0800
  4. Subject: [PATCH] lldb: Link with libatomic on x86
  5. cmake atomic check is not sufficient for i686 target where clang14 still
  6. generates __atomic_store calls but the check does not entail this
  7. function and happily thinks that compiler can resolve all atomic via intrinsics
  8. on i686, but thats not the case, ideally the check for determining
  9. atomic operation should be make more robust but until then lets ask to
  10. link with libatomic on i686/linux
  11. Upstream-Status: Inappropriate [OE-Specific]
  12. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  13. ---
  14. lldb/source/Utility/CMakeLists.txt | 4 ++++
  15. 1 file changed, 4 insertions(+)
  16. diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt
  17. index 89acd7cd2eaf..6aa84f9d284d 100644
  18. --- a/lldb/source/Utility/CMakeLists.txt
  19. +++ b/lldb/source/Utility/CMakeLists.txt
  20. @@ -19,6 +19,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
  21. list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4)
  22. endif ()
  23. +if (CMAKE_SYSTEM_PROCESSOR MATCHES "i686" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
  24. + list(APPEND LLDB_SYSTEM_LIBS atomic)
  25. +endif()
  26. +
  27. if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB )
  28. list(APPEND LLDB_SYSTEM_LIBS atomic)
  29. endif()