I'm trying to execute a binary from this cross-compiler toolchain (link to .tar.bz2 file).
When I try to run the binary, I get a surprising message about the file not being in my $PATH
, even though it exists, and is executable:
$ 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
I am running Ubuntu 18.04 on x86_64, and the architecture of the file I'm running is 32-bit, so I followed this answer to install the i386 libc, but it was not enough.
$ 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
If I run strace
, the stat
of the file is failing:
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)
$PATH
includes ? – Ron Aug 26 '20 at 16:44PATH
is normal (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin
and some others) but I'm not asking the shell to search thePATH
here.ldd
returns nothing because it's statically linked. – rgov Aug 26 '20 at 17:32./
– j0h Aug 26 '20 at 18:15