# 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
@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
$(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 \
$(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)
-funswitch-loops
ifeq ($(TARGET_ARCH),arm)
+ RS_TRIPLE := armv7-unknown-linux
CLANG_CONFIG_EXTRA_ASFLAGS += \
-target arm-linux-androideabi \
-nostdlibinc \
-Wa,--noexecstack
endif
ifeq ($(TARGET_ARCH),mips)
+ RS_TRIPLE := mips-unknown-linux
CLANG_CONFIG_EXTRA_ASFLAGS += \
-target mipsel-linux-androideabi \
-nostdlibinc \
-msynci
endif
ifeq ($(TARGET_ARCH),x86)
+ RS_TRIPLE := i686-unknown-linux
CLANG_CONFIG_EXTRA_ASFLAGS += \
-target i686-linux-android \
-nostdlibinc \