[libc-commits] [libc] 21dcf6b - [libc] Make sure we use the right linker for bitcode linking

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Wed Apr 30 14:25:41 PDT 2025


Author: Joseph Huber
Date: 2025-04-30T16:25:28-05:00
New Revision: 21dcf6bcd1e2845601d07e1e46f17615d595f698

URL: https://github.com/llvm/llvm-project/commit/21dcf6bcd1e2845601d07e1e46f17615d595f698
DIFF: https://github.com/llvm/llvm-project/commit/21dcf6bcd1e2845601d07e1e46f17615d595f698.diff

LOG: [libc] Make sure we use the right linker for bitcode linking

Summary:
We need to use the default arguments to ensure this uses the right
linker for the toolchain given cross-compiling contexts.

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCLibraryRules.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCLibraryRules.cmake b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
index 0b1878d7b5222..80351792fb18a 100644
--- a/libc/cmake/modules/LLVMLibCLibraryRules.cmake
+++ b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
@@ -112,7 +112,7 @@ function(add_bitcode_entrypoint_library target_name base_target_name)
   endforeach()
 
   add_executable(${target_name} ${objects})
-  target_link_options(${target_name} PRIVATE
+  target_link_options(${target_name} PRIVATE "${LIBC_COMPILE_OPTIONS_DEFAULT}"
                       "-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm")
 endfunction(add_bitcode_entrypoint_library)
 


        


More information about the libc-commits mailing list