[llvm-commits] [compiler-rt] r166559 - in /compiler-rt/trunk: Makefile make/lib_info.mk make/options.mk make/platform/clang_darwin.mk make/platform/clang_linux.mk
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Wed Oct 24 07:03:42 PDT 2012
Author: eugenis
Date: Wed Oct 24 09:03:41 2012
New Revision: 166559
URL: http://llvm.org/viewvc/llvm-project?rev=166559&view=rev
Log:
Build ASan runtime for ARM/Android.
Modified:
compiler-rt/trunk/Makefile
compiler-rt/trunk/make/lib_info.mk
compiler-rt/trunk/make/options.mk
compiler-rt/trunk/make/platform/clang_darwin.mk
compiler-rt/trunk/make/platform/clang_linux.mk
Modified: compiler-rt/trunk/Makefile
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/Makefile?rev=166559&r1=166558&r2=166559&view=diff
==============================================================================
--- compiler-rt/trunk/Makefile (original)
+++ compiler-rt/trunk/Makefile Wed Oct 24 09:03:41 2012
@@ -133,10 +133,12 @@
$(call Set,Tmp.ObjPath,$(ProjObjRoot)/$(Tmp.Name)/$(Tmp.Config))
$(call Set,Tmp.SHARED_LIBRARY,$(strip \
$(call GetCNAVar,SHARED_LIBRARY,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch))))
+$(call Set,Tmp.SHARED_LIBRARY_SUFFIX,$(strip \
+ $(call GetCNAVar,SHARED_LIBRARY_SUFFIX,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch))))
# Compute the library suffix.
$(if $(call streq,1,$(Tmp.SHARED_LIBRARY)),
- $(call Set,Tmp.LibrarySuffix,dylib),
+ $(call Set,Tmp.LibrarySuffix,$(Tmp.SHARED_LIBRARY_SUFFIX)),
$(call Set,Tmp.LibrarySuffix,a))
# Compute the archs to build, depending on whether this is a universal build or
@@ -192,7 +194,7 @@
# Compute the library suffix.
$(if $(call streq,1,$(Tmp.SHARED_LIBRARY)),
- $(call Set,Tmp.LibrarySuffix,dylib),
+ $(call Set,Tmp.LibrarySuffix,$(Tmp.SHARED_LIBRARY_SUFFIX)),
$(call Set,Tmp.LibrarySuffix,a))
# Compute the object inputs for this library.
@@ -210,6 +212,10 @@
$(Summary) " DYLIB: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$@"
$(Verb) $(Tmp.CC) -arch $(Tmp.Arch) -dynamiclib -o $$@ \
$(Tmp.Inputs) $(Tmp.LDFLAGS)
+$(Tmp.ObjPath)/libcompiler_rt.so: $(Tmp.Inputs) $(Tmp.ObjPath)/.dir
+ $(Summary) " SO: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$@"
+ $(Verb) $(Tmp.CC) -shared -o $$@ \
+ $(Tmp.Inputs) $(Tmp.LDFLAGS)
.PRECIOUS: $(Tmp.ObjPath)/.dir
# Per-Config-Arch Targets
Modified: compiler-rt/trunk/make/lib_info.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/lib_info.mk?rev=166559&r1=166558&r2=166559&view=diff
==============================================================================
--- compiler-rt/trunk/make/lib_info.mk (original)
+++ compiler-rt/trunk/make/lib_info.mk Wed Oct 24 09:03:41 2012
@@ -56,4 +56,4 @@
CC CFLAGS LDFLAGS FUNCTIONS OPTIMIZED \
RANLIB RANLIBFLAGS \
VISIBILITY_HIDDEN KERNEL_USE \
- SHARED_LIBRARY STRIP LIPO
+ SHARED_LIBRARY SHARED_LIBRARY_SUFFIX STRIP LIPO
Modified: compiler-rt/trunk/make/options.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/options.mk?rev=166559&r1=166558&r2=166559&view=diff
==============================================================================
--- compiler-rt/trunk/make/options.mk (original)
+++ compiler-rt/trunk/make/options.mk Wed Oct 24 09:03:41 2012
@@ -43,3 +43,5 @@
STRIP := strip
LIPO := lipo
+
+SHARED_LIBRARY_SUFFIX := so
Modified: compiler-rt/trunk/make/platform/clang_darwin.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/clang_darwin.mk?rev=166559&r1=166558&r2=166559&view=diff
==============================================================================
--- compiler-rt/trunk/make/platform/clang_darwin.mk (original)
+++ compiler-rt/trunk/make/platform/clang_darwin.mk Wed Oct 24 09:03:41 2012
@@ -435,3 +435,5 @@
KERNEL_USE.cc_kext_ios5 := 1
VISIBILITY_HIDDEN := 1
+
+SHARED_LIBRARY_SUFFIX := dylib
Modified: compiler-rt/trunk/make/platform/clang_linux.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/clang_linux.mk?rev=166559&r1=166558&r2=166559&view=diff
==============================================================================
--- compiler-rt/trunk/make/platform/clang_linux.mk (original)
+++ compiler-rt/trunk/make/platform/clang_linux.mk Wed Oct 24 09:03:41 2012
@@ -66,6 +66,11 @@
Arch.tsan-x86_64 := x86_64
endif
+ifneq ($(LLVM_ANDROID_TOOLCHAIN_DIR),)
+Configs += asan-arm-android
+Arch.asan-arm-android := arm-android
+endif
+
endif
endif
@@ -81,6 +86,14 @@
CFLAGS.asan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin
CFLAGS.tsan-x86_64 := $(CFLAGS) -m64 -fPIE -fno-builtin
+SHARED_LIBRARY.asan-arm-android := 1
+ANDROID_COMMON_FLAGS := -target arm-linux-androideabi \
+ --sysroot=$(LLVM_ANDROID_TOOLCHAIN_DIR)/sysroot \
+ -B$(LLVM_ANDROID_TOOLCHAIN_DIR)
+CFLAGS.asan-arm-android := $(CFLAGS) -fPIC -fno-builtin \
+ $(ANDROID_COMMON_FLAGS) -mllvm -arm-enable-ehabi
+LDFLAGS.asan-arm-android := $(LDFLAGS) $(ANDROID_COMMON_FLAGS) -ldl
+
# 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.
@@ -97,6 +110,8 @@
$(SanitizerCommonFunctions)
FUNCTIONS.asan-x86_64 := $(AsanFunctions) $(InterceptionFunctions) \
$(SanitizerCommonFunctions)
+FUNCTIONS.asan-arm-android := $(AsanFunctions) $(InterceptionFunctions) \
+ $(SanitizerCommonFunctions)
FUNCTIONS.tsan-x86_64 := $(TsanFunctions) $(InterceptionFunctions) \
$(SanitizerCommonFunctions)
@@ -105,3 +120,5 @@
# We don't need to use visibility hidden on Linux.
VISIBILITY_HIDDEN := 0
+
+SHARED_LIBRARY_SUFFIX := so
More information about the llvm-commits
mailing list