[libc-commits] [PATCH] D105643: [libc] Don't pass -fpie/-ffreestanding on Windows

Caitlyn Cano via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jul 8 15:37:59 PDT 2021


caitlyncano updated this revision to Diff 357376.
caitlyncano added a comment.

[libc] Simplify conditional

Unecessary inclusion of an else case removed since Windows will not use any
flags outside the standard compiler flags.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105643/new/

https://reviews.llvm.org/D105643

Files:
  libc/cmake/modules/LLVMLibCObjectRules.cmake


Index: libc/cmake/modules/LLVMLibCObjectRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -1,7 +1,10 @@
 set(OBJECT_LIBRARY_TARGET_TYPE "OBJECT_LIBRARY")
 
 function(_get_common_compile_options output_var)
-  set(${output_var} -fpie ${LLVM_CXX_STD_default} -ffreestanding ${LIBC_COMPILE_OPTIONS_DEFAULT} ${ARGN} PARENT_SCOPE)
+  set(${output_var} ${LLVM_CXX_STD_default} ${LIBC_COMPILE_OPTIONS_DEFAULT} ${ARGN} PARENT_SCOPE)
+  if(NOT ${LIBC_TARGET_OS} STREQUAL "windows")
+    set(${output_var} ${output_var} -fpie -ffreestanding PARENT_SCOPE)
+  endif()
 endfunction()
 
 # Rule which is essentially a wrapper over add_library to compile a set of


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105643.357376.patch
Type: text/x-patch
Size: 780 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20210708/5857db23/attachment.bin>


More information about the libc-commits mailing list