Update RenderScript build config and definitions.

Bug: 38342163

  - obj/lib is deprecated and TARGET_OUT_INTERMEDIATE_LIBRARIES will be
  removed. We need to use per-module intermediates directory instead.
  - prebuilts/ndk/current folder is gone. For libm and libc, we just
  need ndk/r10 as stub libs for linking.

Test: mm and made sure this does not affect on device target.
Test: make -j50 FORCE_BUILD_RS_COMPAT=true RSTest_Compat works as
expected.

Change-Id: I8fbf5c10322707849a23c6b0dacc28b028db451e
diff --git a/core/definitions.mk b/core/definitions.mk
index 63b123e..b5d6326 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1049,8 +1049,9 @@
 	$(dir $@)/$(notdir $(<:.bc=.o)) \
 	$(RS_PREBUILT_COMPILER_RT) \
 	-o $@ $(TARGET_GLOBAL_LDFLAGS) -Wl,--hash-style=sysv -L prebuilts/gcc/ \
-	$(RS_PREBUILT_LIBPATH) -L $(TARGET_OUT_INTERMEDIATE_LIBRARIES) \
-	-lRSSupport -lm -lc
+	$(RS_PREBUILT_LIBPATH) \
+	$(call intermediates-dir-for,SHARED_LIBRARIES,libRSSupport)/libRSSupport.so \
+	-lm -lc
 endef
 
 ###########################################################