diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-11-06 21:44:54 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-11-06 21:44:54 +0000 |
commit | 8ad46b79c3d39e1c7a1494c060e41234711b7d18 (patch) | |
tree | abbcc8c3be00767567fb16fa59db36e2d3505f57 /runtime/compiler-rt | |
parent | 6e990446ce844bb656f19c535286ec434d774054 (diff) |
[build] Update runtime library and tests to work with relocatable SDKs on OS X 10.9.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194168 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/compiler-rt')
-rw-r--r-- | runtime/compiler-rt/Makefile | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/runtime/compiler-rt/Makefile b/runtime/compiler-rt/Makefile index c4d2ad0cf9..7769e3b440 100644 --- a/runtime/compiler-rt/Makefile +++ b/runtime/compiler-rt/Makefile @@ -27,6 +27,10 @@ ResourceIncludeDir := $(ResourceDir)/include PROJ_resources_lib := $(PROJ_resources)/lib PROJ_resources_include := $(PROJ_resources)/include +# Initialize a variable to use for extra flags to pass to the +# compiler-rt make process. +COMPILERRT_MAKE_FLAGS := + # Expect compiler-rt to be in llvm/projects/compiler-rt COMPILERRT_SRC_ROOT := $(LLVM_SRC_ROOT)/projects/compiler-rt @@ -80,6 +84,17 @@ RuntimeLibrary.darwin.Configs := \ asan_osx_dynamic.dylib \ profile_osx.a profile_ios.a \ ubsan_osx.a + +# Support building compiler-rt with relocatable SDKs. +# +# This will cause make to put SDKROOT in the environment, and since we +# are using the built Clang to build compiler-rt, it to pick up that +# location as the default value for the include system root. +ACTIVE_SDK_PATH := $(shell xcrun --show-sdk-path 2> /dev/null) +ifneq ($(ACTIVE_SDK_PATH),) +COMPILERRT_MAKE_FLAGS := SDKROOT=$(ACTIVE_SDK_PATH) +endif + endif # On Linux, include a library which has all the runtime functions. @@ -144,12 +159,14 @@ BuildRuntimeLibraries: ProjObjRoot=$(PROJ_OBJ_DIR) \ CC="$(ToolDir)/clang" \ LLVM_ANDROID_TOOLCHAIN_DIR="$(LLVM_ANDROID_TOOLCHAIN_DIR)" \ + $(COMPILERRT_MAKE_FLAGS) \ $(RuntimeDirs:%=clang_%) .PHONY: BuildRuntimeLibraries CleanRuntimeLibraries: $(Verb) $(MAKE) -C $(COMPILERRT_SRC_ROOT) \ ProjSrcRoot=$(COMPILERRT_SRC_ROOT) \ ProjObjRoot=$(PROJ_OBJ_DIR) \ + $(COMPILERRT_MAKE_FLAGS) \ clean .PHONY: CleanRuntimeLibraries RuntimeHeader: $(ResourceIncludeDir)/sanitizer |