[PATCH] D155398: Linker is unable to find -lclang_rt.builtins-riscv64 library

Ramakota Reddy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 16 02:58:51 PDT 2023


ramakotareddy created this revision.
ramakotareddy added a reviewer: chandlerc.
Herald added subscribers: VincentWu, vkmr, luismarques, sameer.abuasal, s.egerton, Jim, benna, psnobl, abidh, PkmX, rogfer01, shiva0217, kito-cheng, simoncook, asb, arichardson.
Herald added a project: All.
ramakotareddy requested review of this revision.
Herald added subscribers: llvm-commits, wangpc, eopXD.
Herald added a project: LLVM.

LLVM RISCV target clang binary is unable to find the "-lclang_rt.builtins-riscv64" library from baremetal directory. 
But There is a suitable library but with the different name "libclang_rt.builtins.a".

This patch will create baremetal directory and  installed "libclang_rt.builtins.a" library in the baremetal directory with " libclang_rt.builtins-riscv64.a" name.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155398

Files:
  llvm/CMakeLists.txt


Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -1332,3 +1332,13 @@
 if (LLVM_INCLUDE_UTILS AND LLVM_INCLUDE_TOOLS)
   add_subdirectory(utils/llvm-locstats)
 endif()
+
+#install libclang_rt.builtins-riscv64.a in the baremetal directory.
+if(LLVM_TARGETS_TO_BUILD STREQUAL "RISCV")
+  install(DIRECTORY DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/clang/17/lib/baremetal")
+  install(FILES
+    "${CMAKE_CURRENT_BINARY_DIR}/lib/clang/17/lib/riscv64-unknown-elf/libclang_rt.builtins.a"
+    DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/clang/17/lib/baremetal/"
+    RENAME "libclang_rt.builtins-riscv64.a"
+    COMPONENT cmake-exports)
+endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155398.540771.patch
Type: text/x-patch
Size: 733 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230716/d1fa7b8f/attachment.bin>


More information about the llvm-commits mailing list