我正在尝试执行一个二进制文件这个交叉编译工具链(链接到.tar.bz2 文件)。
当我尝试运行二进制文件时,我收到一条令人惊讶的消息,提示该文件不在我的文件中$PATH
,尽管它存在并且可以执行:
$ cross-compiler-armv4l/bin/armv4l-gcc
can't find cross-compiler-armv4l/bin/armv4l-gcc in $PATH
$ ls -l cross-compiler-armv4l/bin/armv4l-gcc
-rwxr-xr-x 1 rzg rzg 31964 Apr 5 2009 cross-compiler-armv4l/bin/armv4l-gcc
我在 x86_64 上运行 Ubuntu 18.04,并且我运行的文件的体系结构是 32 位,因此我遵循这个答案安装 i386 libc,但这还不够。
$ file cross-compiler-armv4l/bin/armv4l-gcc
cross-compiler-armv4l/bin/armv4l-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
如果我运行strace
,则stat
文件的运行将失败:
access("/home/user/busybox-1.32.0/cross-compiler-armv4l/bin/armv4l-gcc", X_OK) = 0
stat("/home/user/busybox-1.32.0/cross-compiler-armv4l/bin/armv4l-gcc", 0xffe4d108) = -1 EOVERFLOW (Value too large for defined data type)