From ffdf34272814d38684fd7bfa42db5b6261b0be70 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 25 Jun 2013 00:57:06 +0000 Subject: [PATCH] Remove the sysroot (or isysroot) restriction from the GCDAProfile.c runtime in the Makefile build system as well. Sorry for the temporary fallout, it took me a while to find these bits. Bill, I'm not at all confident of the change for Darwin and iOS, but as discussed we're completely blocked on fixing this. Anyways, please review and let me know if this will work for you guys. If necessary, I can work with you to rig up an errno.h stub for Darwin, but I expect that to be... moderately challenging. llvm-svn: 184805 --- compiler-rt/make/platform/clang_darwin.mk | 20 ++++++++++++-------- compiler-rt/make/platform/clang_linux.mk | 6 ++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/compiler-rt/make/platform/clang_darwin.mk b/compiler-rt/make/platform/clang_darwin.mk index cb61744e5b7e..8aa4bbf34761 100644 --- a/compiler-rt/make/platform/clang_darwin.mk +++ b/compiler-rt/make/platform/clang_darwin.mk @@ -117,6 +117,18 @@ IOS_DEPLOYMENT_ARGS := -mios-version-min=1.0 IOS6_DEPLOYMENT_ARGS := -mios-version-min=6.0 IOSSIM_DEPLOYMENT_ARGS := -mios-simulator-version-min=1.0 +# Setup the CFLAGS for the profile runtime library before narrowing the +# deployment args to use the compiler-rt fake header sysroot as we want the +# profile runtime to have access to basic libc routines, etc. +CFLAGS.profile_osx.i386 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS) +CFLAGS.profile_osx.x86_64 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS) +CFLAGS.profile_ios.i386 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS) +CFLAGS.profile_ios.x86_64 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS) +CFLAGS.profile_ios.armv7 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) +CFLAGS.profile_ios.armv7f := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) +CFLAGS.profile_ios.armv7k := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) +CFLAGS.profile_ios.armv7s := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) + # Use our stub SDK as the sysroot to support more portable building. OSX_DEPLOYMENT_ARGS += -isysroot $(ProjSrcRoot)/SDKs/darwin IOS_DEPLOYMENT_ARGS += -isysroot $(ProjSrcRoot)/SDKs/darwin @@ -152,14 +164,6 @@ CFLAGS.cc_kext_ios5.armv7 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) CFLAGS.cc_kext_ios5.armv7f := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) CFLAGS.cc_kext_ios5.armv7k := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) CFLAGS.cc_kext_ios5.armv7s := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) -CFLAGS.profile_osx.i386 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS) -CFLAGS.profile_osx.x86_64 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS) -CFLAGS.profile_ios.i386 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS) -CFLAGS.profile_ios.x86_64 := $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS) -CFLAGS.profile_ios.armv7 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) -CFLAGS.profile_ios.armv7f := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) -CFLAGS.profile_ios.armv7k := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) -CFLAGS.profile_ios.armv7s := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS) # Configure the asan_osx_dynamic library to be built shared. SHARED_LIBRARY.asan_osx_dynamic := 1 diff --git a/compiler-rt/make/platform/clang_linux.mk b/compiler-rt/make/platform/clang_linux.mk index 229430e33a2b..b16e794446eb 100644 --- a/compiler-rt/make/platform/clang_linux.mk +++ b/compiler-rt/make/platform/clang_linux.mk @@ -112,12 +112,10 @@ LDFLAGS.asan-arm-android := $(LDFLAGS) $(ANDROID_COMMON_FLAGS) -ldl \ -Wl,-soname=libclang_rt.asan-arm-android.so # Use our stub SDK as the sysroot to support more portable building. For now we -# just do this for the non-ASAN modules, because the stub SDK doesn't have -# enough support to build ASAN. +# just do this for the core module, because the stub SDK doesn't have +# enough support to build the sanitizers or profile runtimes. CFLAGS.full-i386 += --sysroot=$(ProjSrcRoot)/SDKs/linux CFLAGS.full-x86_64 += --sysroot=$(ProjSrcRoot)/SDKs/linux -CFLAGS.profile-i386 += --sysroot=$(ProjSrcRoot)/SDKs/linux -CFLAGS.profile-x86_64 += --sysroot=$(ProjSrcRoot)/SDKs/linux FUNCTIONS.full-i386 := $(CommonFunctions) $(ArchFunctions.i386) FUNCTIONS.full-x86_64 := $(CommonFunctions) $(ArchFunctions.x86_64)