[libc-commits] [libc] [libc] suppress stdlib explicitly (PR #76079)

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Wed Dec 20 09:19:58 PST 2023


https://github.com/SchrodingerZhu created https://github.com/llvm/llvm-project/pull/76079

None

>From 73511704a613f88bbd06741709ebc2064f3a4c00 Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <yifanzhu at rochester.edu>
Date: Wed, 20 Dec 2023 12:18:21 -0500
Subject: [PATCH] [libc] suppress stdlib explicitly

---
 libc/startup/linux/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/startup/linux/CMakeLists.txt b/libc/startup/linux/CMakeLists.txt
index d81c7db7a558b3..2d55a365669718 100644
--- a/libc/startup/linux/CMakeLists.txt
+++ b/libc/startup/linux/CMakeLists.txt
@@ -26,7 +26,7 @@ function(merge_relocatable_object name)
   )
   # Pass -r to the driver is much cleaner than passing -Wl,-r: the compiler knows it is
   # a relocatable linking and will not pass other irrelevant flags to the linker.
-  target_link_options(${relocatable_target} PRIVATE -r)
+  target_link_options(${relocatable_target} PRIVATE -r -nostdlib)
   set_target_properties(
     ${relocatable_target}
     PROPERTIES



More information about the libc-commits mailing list