summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-11-12 22:37:03 +0000
committerChris Bieneman <beanz@apple.com>2015-11-12 22:37:03 +0000
commit44e875b59b28f4e85c1697766cf33d7bd042fc4a (patch)
tree8c58d9194a424b4ad70cef15430646e06919c264 /cmake
parent2af7588d6a9ad6d10328fa27d185f6ab2a425834 (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252966 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/CompilerRTDarwinUtils.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake
index 18ddc0e3c..52f89fd1f 100644
--- a/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ b/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -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_libraries)
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)