我试图在定制的Android图像安装预编译的二进制文件。 对于我把它复制到一个新的目录prebuilt/android-arm/
与Android.mk
文件与此类似:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := binary_name
LOCAL_MODULE := binary_name
LOCAL_MODULE_CLASS := EXECUTABLES
include $(BUILD_PREBUILT)
所以,如果我跑make system_image binary_name
,二进制文件复制到/bin/
系统映像。 如果我运行模拟器我可以看到在二进制文件/system/bin
。 权限是一样的其他可执行文件( -rwxr-xr-x
并且根据file
,这是二进制的臂( ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped
)。
但是,当我在模拟器上运行它,它说:
# binary_name
binary_name: not found
我已经straced它,这是我所看到的:
# strace binary_name
execve("/system/bin/binary_name", ["binary_name"], [/* 9 vars */]) = -1 ENOENT (No such file or directory)
write(2, "strace: exec", 12strace: exec) = 12
write(2, ": ", 2: ) = 2
write(2, "No such file or directory", 25No such file or directory) = 25
write(2, "\n", 1
) = 1
io_submit(1, -1344063348, {...} <unfinished ... exit status 1>
但是,该文件是存在的,而且是strace的能够找到它。
任何想法什么可以发生?
更新 :由于克里斯托夫说,这可能是动态链接的问题,但我没有LDD为Android ARM ...