[libc-commits] [libc] [libc] [startup] add cmake function to merge separated crt1 objects (PR #75413)
Schrodinger ZHU Yifan via libc-commits
libc-commits at lists.llvm.org
Mon Dec 18 15:03:03 PST 2023
================
@@ -27,18 +70,24 @@ function(add_startup_object name)
)
endfunction()
+check_cxx_compiler_flag("-r" LIBC_LINKER_SUPPORTS_RELOCATABLE)
+
+if(NOT LIBC_LINKER_SUPPORTS_RELOCATABLE)
+ message(STATUS "Skipping startup for target architecture ${LIBC_TARGET_ARCHITECTURE}: linker does not support -r")
+ return()
+endif()
+
if(NOT (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_ARCHITECTURE}))
message(STATUS "Skipping startup for target architecture ${LIBC_TARGET_ARCHITECTURE}")
return()
endif()
add_subdirectory(${LIBC_TARGET_ARCHITECTURE})
-add_startup_object(
+# TODO: factor out crt1 into multiple objects
----------------
SchrodingerZhu wrote:
https://github.com/llvm/llvm-project/pull/75717 is another related change. The purpose of #75717 is to define `LIBC_NAMESPACE::app` symbol regardless it is in the full build or the overlay mode; but the patch also reduced "duplicated" definition of the same symbol.
https://github.com/llvm/llvm-project/pull/75413
More information about the libc-commits
mailing list