[PATCH] D24099: [libc++] Don't add -fPIC on Windows

Shoaib Meenai via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 31 13:33:56 PDT 2016


smeenai created this revision.
smeenai added reviewers: compnerd, EricWF, mclow.lists.
smeenai added a subscriber: cfe-commits.

-fPIC doesn't make much sense for Windows, since Windows DLLs aren't
compiled position independent and are instead relocated at runtime
instead.

https://reviews.llvm.org/D24099

Files:
  lib/CMakeLists.txt

Index: lib/CMakeLists.txt
===================================================================
--- lib/CMakeLists.txt
+++ lib/CMakeLists.txt
@@ -72,7 +72,9 @@
 add_library_flags_if(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB atomic)
 
 # Setup flags.
-add_flags_if_supported(-fPIC)
+if (NOT WIN32)
+  add_flags_if_supported(-fPIC)
+endif()
 add_link_flags_if_supported(-nodefaultlibs)
 
 if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24099.69897.patch
Type: text/x-patch
Size: 439 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160831/310026c6/attachment.bin>


More information about the cfe-commits mailing list