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

Arthur Eubanks via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jul 8 15:31:13 PDT 2021


aeubanks added inline comments.


================
Comment at: libc/cmake/modules/LLVMLibCObjectRules.cmake:6
+  if(${LIBC_TARGET_OS} STREQUAL "windows")
+    set(${output_var} ${output_var} /Qfreestanding PARENT_SCOPE)
+  else()
----------------
aeubanks wrote:
> caitlyncano wrote:
> > caitlyncano wrote:
> > > aeubanks wrote:
> > > > actually I don't see this available in clang-cl or msvc, where did you find this?
> > > This is the for the Intel compiler and since the Linux flag syntax was the same I figured I could use the Windows equivalent? Not sure (https://software.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/compiler-reference/compiler-options/compiler-option-details/advanced-optimization-options/ffreestanding-qfreestanding.html)
> > But it seems like in this article (https://nullprogram.com/blog/2016/01/31/) -ffreestanding is available on MinGW so maybe that's where we'd have to build llvmlibc to ensure the freestanding environment?
> that looks like it only works on the intel C++ compiler, it won't work with msvc or clang which is what we care about on windows
> 
> let's try not adding any alternatives for -fpie/-ffreestanding for now on windows
`/Qfreestanding` is only available on the intel C++ compiler for windows

`-ffreestanding` is available on gcc/clang/intel for Linux

mingw is similar to Linux (even it's on windows) and uses gcc, but we currently don't care about mingw, at least for llvm libc


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105643



More information about the libc-commits mailing list