Add support for multiple architectures with RS compat lib.

Change-Id: I310f6f72e1124c06e9c59b0f59d33f168dc1e632
This commit is contained in:
Tim Murray 2013-03-05 11:07:15 -08:00
parent 42e05e040e
commit 1a6f09a48c
4 changed files with 14 additions and 21 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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 \