[compiler-rt] r252966 - [CMake] [Darwin] Forcing -fPIC on for all darwin builtins except macho_embedded

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 12 14:37:03 PST 2015


Author: cbieneman
Date: Thu Nov 12 16:37:03 2015
New Revision: 252966

URL: http://llvm.org/viewvc/llvm-project?rev=252966&view=rev
Log:
[CMake] [Darwin] Forcing -fPIC on for all darwin builtins except macho_embedded

We need to add -fPIC to the flags for the builtins in case PIC was turned off at a higher level. We also want to set ENABLE_PIC to Off when building the macho_embedded builtins so the top-level settings don't impact that build.

Modified:
    compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake

Modified: compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake?rev=252966&r1=252965&r2=252966&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake Thu Nov 12 16:37:03 2015
@@ -258,7 +258,7 @@ endfunction()
 macro(darwin_add_builtin_libraries)
   set(DARWIN_EXCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Darwin-excludes)
 
-  set(CFLAGS "-O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer")
+  set(CFLAGS "-fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer")
   set(CMAKE_C_FLAGS "")
   set(CMAKE_CXX_FLAGS "")
   set(CMAKE_ASM_FLAGS "")
@@ -367,6 +367,7 @@ macro(darwin_add_embedded_builtin_librar
   set(SOFT_FLOAT_FLAG -mfloat-abi=soft)
   set(HARD_FLOAT_FLAG -mfloat-abi=hard)
 
+  set(ENABLE_PIC Off)
   set(PIC_FLAG -fPIC)
   set(STATIC_FLAG -static)
 




More information about the llvm-commits mailing list