0015-libcxx-Add-compiler-runtime-library-to-link-step-for.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From a096db3cc09b352c027799ae05feeca468a0e6e2 Mon Sep 17 00:00:00 2001
  2. From: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  3. Date: Tue, 9 Nov 2021 10:24:03 +0800
  4. Subject: [PATCH 15/34] libcxx: Add compiler runtime library to link step for
  5. libcxx
  6. This corrects "undefined reference to __divti3"
  7. Upstream-Status: Inappropriate [configuration]
  8. Rebased to LLVM 14.0.0 by Jun Yuan Tan
  9. Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
  10. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  11. Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  12. ---
  13. libcxx/src/CMakeLists.txt | 4 ++--
  14. 1 file changed, 2 insertions(+), 2 deletions(-)
  15. diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
  16. index 0bcfb1776271..488206d8324d 100644
  17. --- a/libcxx/src/CMakeLists.txt
  18. +++ b/libcxx/src/CMakeLists.txt
  19. @@ -196,7 +196,7 @@ split_list(LIBCXX_LINK_FLAGS)
  20. if (LIBCXX_ENABLE_SHARED)
  21. add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
  22. target_link_libraries(cxx_shared PUBLIC cxx-headers
  23. - PRIVATE ${LIBCXX_LIBRARIES})
  24. + PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)")
  25. set_target_properties(cxx_shared
  26. PROPERTIES
  27. COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
  28. @@ -274,7 +274,7 @@ set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
  29. if (LIBCXX_ENABLE_STATIC)
  30. add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
  31. target_link_libraries(cxx_static PUBLIC cxx-headers
  32. - PRIVATE ${LIBCXX_LIBRARIES})
  33. + PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)")
  34. set_target_properties(cxx_static
  35. PROPERTIES
  36. COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
  37. --
  38. 2.33.1