[libc-commits] [PATCH] D158652: [libc] Only add -ffreestanding flag in full build mode.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Aug 23 11:38:16 PDT 2023


lntue created this revision.
lntue added reviewers: michaelrj, sivachandra.
Herald added projects: libc-project, All.
lntue requested review of this revision.

Only add -ffreestanding flag in full build mode.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158652

Files:
  libc/cmake/modules/LLVMLibCObjectRules.cmake


Index: libc/cmake/modules/LLVMLibCObjectRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -21,7 +21,12 @@
   set(compile_options ${LIBC_COMPILE_OPTIONS_DEFAULT} ${ARGN})
   if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
     list(APPEND compile_options "-fpie")
-    list(APPEND compile_options "-ffreestanding")
+
+    if(LLVM_LIBC_FULL_BUILD)
+      # Only add -ffreestanding flag in full build mode.
+      list(APPEND compile_options "-ffreestanding")
+    endif()
+
     list(APPEND compile_options "-fno-builtin")
     list(APPEND compile_options "-fno-exceptions")
     list(APPEND compile_options "-fno-lax-vector-conversions")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158652.552821.patch
Type: text/x-patch
Size: 756 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230823/87b857bf/attachment.bin>


More information about the libc-commits mailing list