summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2013-03-05 11:07:15 -0800
committerTim Murray <timmurray@google.com>2013-03-06 17:15:26 -0800
commit1a6f09a48c2047a6611b3f01088530b2ec895f7b (patch)
treeb5a75f6c9a371cd9f9af6885d7425e103f328473 /core
parent42e05e040e18367a4597564533c1af5642ebf79c (diff)
downloadbuild-1a6f09a48c2047a6611b3f01088530b2ec895f7b.zip
build-1a6f09a48c2047a6611b3f01088530b2ec895f7b.tar.gz
build-1a6f09a48c2047a6611b3f01088530b2ec895f7b.tar.bz2
Add support for multiple architectures with RS compat lib.
Change-Id: I310f6f72e1124c06e9c59b0f59d33f168dc1e632
Diffstat (limited to 'core')
-rw-r--r--core/config.mk8
-rw-r--r--core/definitions.mk6
-rw-r--r--core/java.mk18
-rw-r--r--core/llvm_config.mk3
4 files changed, 14 insertions, 21 deletions
diff --git a/core/config.mk b/core/config.mk
index d8d7871..be2c23b 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -443,4 +443,10 @@ INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/publi
# objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so
TARGET_PREBUILT_TAG := android-$(TARGET_ARCH)
-include $(BUILD_SYSTEM)/dumpvar.mk
+# Set up RS prebuilt variables for compatibility library
+
+RS_PREBUILT_CLCORE := prebuilts/sdk/renderscript/lib/$(TARGET_ARCH)/libclcore.bc
+RS_PREBUILT_LIBPATH := -L prebuilts/ndk/8/platforms/android-9/arch-$(TARGET_ARCH)/usr/lib
+RS_PREBUILT_COMPILER_RT := prebuilts/sdk/renderscript/lib/$(TARGET_ARCH)/libcompiler_rt.a
+
+include $(BUILD_SYSTEM)/dumpvar.mk \ No newline at end of file
diff --git a/core/definitions.mk b/core/definitions.mk
index e895f95..2cf5283 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -826,13 +826,13 @@ define transform-bc-to-so
@echo "Renderscript compatibility: $(notdir $@) <= $(notdir $<)"
$(hide) mkdir -p $(dir $@)
$(hide) $(BCC_COMPAT) -O3 -o $(dir $@)/$(notdir $(<:.bc=.o)) -fPIC -shared \
- -rt-path $(PRIVATE_LIBCLCORE) $<
+ -rt-path $(RS_PREBUILT_CLCORE) -mtriple $(RS_TRIPLE) $<
$(hide) $(PRIVATE_CXX) -shared -Wl,-soname,$(notdir $@) -nostdlib \
-Wl,-rpath,\$$ORIGIN/../lib \
$(dir $@)/$(notdir $(<:.bc=.o)) \
- $(PRIVATE_COMPILER_RT) \
+ $(RS_PREBUILT_COMPILER_RT) \
-o $@ -L prebuilts/gcc/ \
- -L $(TARGET_OUT_INTERMEDIATE_LIBRARIES) $(PRIVATE_LIBPATH) \
+ -L $(TARGET_OUT_INTERMEDIATE_LIBRARIES) $(RS_PREBUILT_LIBPATH) \
-lRSSupport -lm
endef
diff --git a/core/java.mk b/core/java.mk
index 22b4e75..da670f9 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -196,10 +196,6 @@ $(RenderScript_file_stamp): PRIVATE_RS_TARGET_API := $(renderscript_target_api)
$(RenderScript_file_stamp): $(renderscript_sources_fullpath) $(LOCAL_RENDERSCRIPT_CC)
$(transform-renderscripts-to-java-and-bc)
-# Now LOCAL_RENDERSCRIPT_COMPATIBILITY only supports arm
-ifneq ($(TARGET_ARCH),arm)
-LOCAL_RENDERSCRIPT_COMPATIBILITY :=
-endif
ifneq ($(LOCAL_RENDERSCRIPT_COMPATIBILITY),)
bc_files := $(patsubst %.fs,%.bc, $(patsubst %.rs,%.bc, $(notdir $(renderscript_sources))))
rs_generated_bc := $(addprefix \
@@ -212,26 +208,14 @@ rs_compatibility_jni_libs := $(addprefix \
$(rs_generated_bc) : $(RenderScript_file_stamp)
-ifeq (,$(TARGET_BUILD_APPS))
-rs_built_clcore := $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libclcore.bc_intermediates/libclcore.bc
-rs_extra_libpath :=
-rs_compiler_rt := $(call intermediates-dir-for,STATIC_LIBRARIES,libcompiler_rt)/libcompiler_rt.a
-else
-rs_built_clcore := prebuilts/sdk/renderscript/lib/libclcore.bc
-rs_extra_libpath := -L prebuilts/ndk/8/platforms/android-9/arch-arm/usr/lib
-rs_compiler_rt := prebuilts/sdk/renderscript/lib/libcompiler_rt.a
-endif # TARGET_BUILD_APPS
rs_support_lib := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libRSSupport.so
rs_jni_lib := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/librsjni.so
LOCAL_JNI_SHARED_LIBRARIES += libRSSupport librsjni
-$(rs_compatibility_jni_libs): $(RenderScript_file_stamp) $(rs_built_clcore) \
+$(rs_compatibility_jni_libs): $(RenderScript_file_stamp) $(RS_PREBUILT_CLCORE) \
$(rs_support_lib) $(rs_jni_lib) $(rs_compiler_rt)
$(rs_compatibility_jni_libs): | $(BCC_COMPAT)
$(rs_compatibility_jni_libs): PRIVATE_CXX := $(TARGET_CXX)
-$(rs_compatibility_jni_libs): PRIVATE_LIBCLCORE := $(rs_built_clcore)
-$(rs_compatibility_jni_libs): PRIVATE_COMPILER_RT := $(rs_compiler_rt)
-$(rs_compatibility_jni_libs): PRIVATE_LIBPATH := $(rs_extra_libpath)
$(rs_compatibility_jni_libs): $(renderscript_intermediate)/librs.%.so: \
$(renderscript_intermediate.COMMON)/res/raw/%.bc
$(transform-bc-to-so)
diff --git a/core/llvm_config.mk b/core/llvm_config.mk
index 2f59edd..7d1c4e1 100644
--- a/core/llvm_config.mk
+++ b/core/llvm_config.mk
@@ -20,6 +20,7 @@ CLANG_CONFIG_UNKNOWN_CFLAGS := \
-funswitch-loops
ifeq ($(TARGET_ARCH),arm)
+ RS_TRIPLE := armv7-unknown-linux
CLANG_CONFIG_EXTRA_ASFLAGS += \
-target arm-linux-androideabi \
-nostdlibinc \
@@ -41,6 +42,7 @@ ifeq ($(TARGET_ARCH),arm)
-Wa,--noexecstack
endif
ifeq ($(TARGET_ARCH),mips)
+ RS_TRIPLE := mips-unknown-linux
CLANG_CONFIG_EXTRA_ASFLAGS += \
-target mipsel-linux-androideabi \
-nostdlibinc \
@@ -65,6 +67,7 @@ ifeq ($(TARGET_ARCH),mips)
-msynci
endif
ifeq ($(TARGET_ARCH),x86)
+ RS_TRIPLE := i686-unknown-linux
CLANG_CONFIG_EXTRA_ASFLAGS += \
-target i686-linux-android \
-nostdlibinc \