[libc-commits] [libc] 4d97766 - [libc] Install startup files with the install-libc target.

Siva Chandra Reddy via libc-commits libc-commits at lists.llvm.org
Fri Aug 19 13:15:51 PDT 2022


Author: Siva Chandra Reddy
Date: 2022-08-19T20:15:16Z
New Revision: 4d977663167eddd2a1248f8675c9a832d8dfcdf7

URL: https://github.com/llvm/llvm-project/commit/4d977663167eddd2a1248f8675c9a832d8dfcdf7
DIFF: https://github.com/llvm/llvm-project/commit/4d977663167eddd2a1248f8675c9a832d8dfcdf7.diff

LOG: [libc] Install startup files with the install-libc target.

Differential Revision: https://reviews.llvm.org/D132212

Added: 
    

Modified: 
    libc/CMakeLists.txt
    libc/loader/linux/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index aaf4b153c397..15af22476ad1 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -148,7 +148,7 @@ set(LIBC_INSTALL_TARGET)
 if(LLVM_LIBC_FULL_BUILD)
   set(LIBC_TARGET libc)
   set(LIBC_COMPONENT libc)
-  set(LIBC_INSTALL_DEPENDS "libc;libc-headers")
+  set(LIBC_INSTALL_DEPENDS "libc;libc-headers;libc-startup")
   set(LIBC_INSTALL_TARGET install-libc)
   set(LIBC_ARCHIVE_NAME c)
 else()

diff  --git a/libc/loader/linux/CMakeLists.txt b/libc/loader/linux/CMakeLists.txt
index b803945097b5..92ff8965b206 100644
--- a/libc/loader/linux/CMakeLists.txt
+++ b/libc/loader/linux/CMakeLists.txt
@@ -83,3 +83,14 @@ add_loader_object(
   SRC
     crtn.cpp
 )
+
+add_custom_target(libc-startup)
+set(startup_components crt1 crti crtn)
+foreach(target IN LISTS startup_components)
+  set(fq_target_name libc.loader.linux.${target})
+  add_dependencies(libc-startup ${fq_target_name})
+  get_target_property(loader_object ${fq_target_name} LOADER_OBJECT)
+  install(FILES ${loader_object}
+          DESTINATION ${CMAKE_INSTALL_LIBDIR}
+          COMPONENT ${LIBC_COMPONENT})
+endforeach()


        


More information about the libc-commits mailing list