aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLai Wei-Chih <Robert.Lai@mediatek.com>2015-01-06 15:22:15 +0800
committerLai Wei-Chih <Robert.Lai@mediatek.com>2015-01-16 14:49:15 +0800
commit4c2c6ce2e19631291f8b39b34bf94f03d7986194 (patch)
treeaf24f6394438982028d3fb026e1e1c962928c468 /tests
parentba70313fc325eaaaf5aca87cef09a753446f8cca (diff)
downloadndk-4c2c6ce2e19631291f8b39b34bf94f03d7986194.tar.gz
Misc fix for abcc.
Change-Id: I994283f8182a0162f9a02be6a9087735ec8195ff
Diffstat (limited to 'tests')
-rw-r--r--tests/abcc/jni/Abcc.h6
-rw-r--r--tests/abcc/jni/Android.mk5
-rw-r--r--tests/abcc/jni/device/Abcc_device.cpp14
-rw-r--r--tests/abcc/src/compiler/abcc/AbccService.java6
4 files changed, 22 insertions, 9 deletions
diff --git a/tests/abcc/jni/Abcc.h b/tests/abcc/jni/Abcc.h
index a9c53a772..9ea565d0b 100644
--- a/tests/abcc/jni/Abcc.h
+++ b/tests/abcc/jni/Abcc.h
@@ -21,7 +21,13 @@
#include <map>
#include <string>
#include <vector>
+
+// Always use latest llvm for on-device abcc
+#if ON_DEVICE
+#include "llvm_35.h"
+#else
#include "llvm_version.h"
+#endif
namespace abcc {
diff --git a/tests/abcc/jni/Android.mk b/tests/abcc/jni/Android.mk
index c3b184a76..f665fd1f4 100644
--- a/tests/abcc/jni/Android.mk
+++ b/tests/abcc/jni/Android.mk
@@ -21,6 +21,7 @@ SYSTEM_PREBUILT_PACKAGE ?= true
LOCAL_MODULE := libjni_abcc
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_C_INCLUDES := $(LOCAL_PATH)/device
+LOCAL_CFLAGS += -DON_DEVICE=1
LOCAL_SRC_FILES := \
Abcc.cpp \
device/Abcc_device.cpp \
@@ -35,8 +36,8 @@ include external/stlport/libstlport.mk
include $(BUILD_SHARED_LIBRARY)
else # SYSTEM_PREBUILT_PACKAGE
-LOCAL_CFLAGS += -DON_DEVICE=1
-LOCAL_CFLAGS += -DENABLE_PARALLEL_LLVM_CG=1
+#FIXME: parallel llvm codegen is not yet ported to llvm-3.5
+#LOCAL_CFLAGS += -DENABLE_PARALLEL_LLVM_CG=1
LOCAL_CFLAGS += -DVERBOSE=0
LOCAL_LDLIBS := -llog
LOCAL_STATIC_LIBRARIES := cpufeatures
diff --git a/tests/abcc/jni/device/Abcc_device.cpp b/tests/abcc/jni/device/Abcc_device.cpp
index b0aecdc49..ea0906c48 100644
--- a/tests/abcc/jni/device/Abcc_device.cpp
+++ b/tests/abcc/jni/device/Abcc_device.cpp
@@ -33,6 +33,12 @@ using namespace abcc;
# define CURRENT_ABI "x86"
#elif defined(__mips__)
# define CURRENT_ABI "mips"
+#elif defined(__aarch64__)
+# define CURRENT_ABI "arm64-v8a"
+#elif defined(__x86_64__)
+# define CURRENT_ABI "x86_64"
+#elif defined(__mips64)
+# define CURRENT_ABI "mips64"
#else
# error "Unsupport target abi"
#endif
@@ -103,6 +109,7 @@ void DeviceBitcodeCompiler::getBitcodeFiles() {
std::vector<std::string> bc_files,lib_files;
DIR *dp = opendir(mWorkingDir.c_str());
if (!dp) {
+ LOGE("Error opening working dir: %s", mWorkingDir.c_str());
mRet = RET_FAIL_PREPARE_BITCODE;
return;
}
@@ -193,7 +200,12 @@ void DeviceBitcodeCompiler::prepareToolchain() {
cmd += " " + mSysroot + "/usr/bin/ld.mcld";
cmd += " -L" + mWorkingDir;
cmd += " -L" + mSysroot + "/usr/lib";
- cmd += " -L/system/lib";
+
+ if (mAbi == TargetAbi::X86_64 || mAbi == TargetAbi::ARM64_V8A || mAbi == TargetAbi::MIPS64)
+ cmd += " -L/system/lib64";
+ else
+ cmd += " -L/system/lib";
+
mExecutableToolsPath[(unsigned)CMD_LINK] = cmd;
cmd = " @" + mSysroot + "/usr/lib/libportable.wrap " + mSysroot + "/usr/lib/libportable.a";
diff --git a/tests/abcc/src/compiler/abcc/AbccService.java b/tests/abcc/src/compiler/abcc/AbccService.java
index 193acbddd..303c26cf3 100644
--- a/tests/abcc/src/compiler/abcc/AbccService.java
+++ b/tests/abcc/src/compiler/abcc/AbccService.java
@@ -264,12 +264,6 @@ public class AbccService extends IntentService {
private native int genLibs(String working_dir, String sysroot);
static {
- // Distinguish whether this is a system prebuilt apk or an updated apk
- // ApplicationInfo info = getApplicationInfo();
- // FIXME: We cannot access ApplicationInfo in static context, how to prevent magic path?
- if (new File("/data/data/compiler.abcc/lib/libjni_abcc.so").exists())
System.loadLibrary("jni_abcc");
- else
- System.load("/system/lib/libjni_abcc.so");
}
}