Add support for multiple architectures with RS compat lib.
Change-Id: I310f6f72e1124c06e9c59b0f59d33f168dc1e632
This commit is contained in:
@@ -443,4 +443,10 @@ INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/publi
|
|||||||
# objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so
|
# objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so
|
||||||
TARGET_PREBUILT_TAG := android-$(TARGET_ARCH)
|
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
|
@@ -826,13 +826,13 @@ define transform-bc-to-so
|
|||||||
@echo "Renderscript compatibility: $(notdir $@) <= $(notdir $<)"
|
@echo "Renderscript compatibility: $(notdir $@) <= $(notdir $<)"
|
||||||
$(hide) mkdir -p $(dir $@)
|
$(hide) mkdir -p $(dir $@)
|
||||||
$(hide) $(BCC_COMPAT) -O3 -o $(dir $@)/$(notdir $(<:.bc=.o)) -fPIC -shared \
|
$(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 \
|
$(hide) $(PRIVATE_CXX) -shared -Wl,-soname,$(notdir $@) -nostdlib \
|
||||||
-Wl,-rpath,\$$ORIGIN/../lib \
|
-Wl,-rpath,\$$ORIGIN/../lib \
|
||||||
$(dir $@)/$(notdir $(<:.bc=.o)) \
|
$(dir $@)/$(notdir $(<:.bc=.o)) \
|
||||||
$(PRIVATE_COMPILER_RT) \
|
$(RS_PREBUILT_COMPILER_RT) \
|
||||||
-o $@ -L prebuilts/gcc/ \
|
-o $@ -L prebuilts/gcc/ \
|
||||||
-L $(TARGET_OUT_INTERMEDIATE_LIBRARIES) $(PRIVATE_LIBPATH) \
|
-L $(TARGET_OUT_INTERMEDIATE_LIBRARIES) $(RS_PREBUILT_LIBPATH) \
|
||||||
-lRSSupport -lm
|
-lRSSupport -lm
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
18
core/java.mk
18
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)
|
$(RenderScript_file_stamp): $(renderscript_sources_fullpath) $(LOCAL_RENDERSCRIPT_CC)
|
||||||
$(transform-renderscripts-to-java-and-bc)
|
$(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),)
|
ifneq ($(LOCAL_RENDERSCRIPT_COMPATIBILITY),)
|
||||||
bc_files := $(patsubst %.fs,%.bc, $(patsubst %.rs,%.bc, $(notdir $(renderscript_sources))))
|
bc_files := $(patsubst %.fs,%.bc, $(patsubst %.rs,%.bc, $(notdir $(renderscript_sources))))
|
||||||
rs_generated_bc := $(addprefix \
|
rs_generated_bc := $(addprefix \
|
||||||
@@ -212,26 +208,14 @@ rs_compatibility_jni_libs := $(addprefix \
|
|||||||
|
|
||||||
$(rs_generated_bc) : $(RenderScript_file_stamp)
|
$(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_support_lib := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libRSSupport.so
|
||||||
rs_jni_lib := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/librsjni.so
|
rs_jni_lib := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/librsjni.so
|
||||||
LOCAL_JNI_SHARED_LIBRARIES += libRSSupport librsjni
|
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_support_lib) $(rs_jni_lib) $(rs_compiler_rt)
|
||||||
$(rs_compatibility_jni_libs): | $(BCC_COMPAT)
|
$(rs_compatibility_jni_libs): | $(BCC_COMPAT)
|
||||||
$(rs_compatibility_jni_libs): PRIVATE_CXX := $(TARGET_CXX)
|
$(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: \
|
$(rs_compatibility_jni_libs): $(renderscript_intermediate)/librs.%.so: \
|
||||||
$(renderscript_intermediate.COMMON)/res/raw/%.bc
|
$(renderscript_intermediate.COMMON)/res/raw/%.bc
|
||||||
$(transform-bc-to-so)
|
$(transform-bc-to-so)
|
||||||
|
@@ -20,6 +20,7 @@ CLANG_CONFIG_UNKNOWN_CFLAGS := \
|
|||||||
-funswitch-loops
|
-funswitch-loops
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH),arm)
|
ifeq ($(TARGET_ARCH),arm)
|
||||||
|
RS_TRIPLE := armv7-unknown-linux
|
||||||
CLANG_CONFIG_EXTRA_ASFLAGS += \
|
CLANG_CONFIG_EXTRA_ASFLAGS += \
|
||||||
-target arm-linux-androideabi \
|
-target arm-linux-androideabi \
|
||||||
-nostdlibinc \
|
-nostdlibinc \
|
||||||
@@ -41,6 +42,7 @@ ifeq ($(TARGET_ARCH),arm)
|
|||||||
-Wa,--noexecstack
|
-Wa,--noexecstack
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_ARCH),mips)
|
ifeq ($(TARGET_ARCH),mips)
|
||||||
|
RS_TRIPLE := mips-unknown-linux
|
||||||
CLANG_CONFIG_EXTRA_ASFLAGS += \
|
CLANG_CONFIG_EXTRA_ASFLAGS += \
|
||||||
-target mipsel-linux-androideabi \
|
-target mipsel-linux-androideabi \
|
||||||
-nostdlibinc \
|
-nostdlibinc \
|
||||||
@@ -65,6 +67,7 @@ ifeq ($(TARGET_ARCH),mips)
|
|||||||
-msynci
|
-msynci
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_ARCH),x86)
|
ifeq ($(TARGET_ARCH),x86)
|
||||||
|
RS_TRIPLE := i686-unknown-linux
|
||||||
CLANG_CONFIG_EXTRA_ASFLAGS += \
|
CLANG_CONFIG_EXTRA_ASFLAGS += \
|
||||||
-target i686-linux-android \
|
-target i686-linux-android \
|
||||||
-nostdlibinc \
|
-nostdlibinc \
|
||||||
|
Reference in New Issue
Block a user