0

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)
rgov
  • 409
  • 1
    Can you also add what your $PATH includes ? – Ron Aug 26 '20 at 16:44
  • 1
    Does running the 32 bit program work if you use an absolute path (so no PATH lookup needed)? Does running ldd on the 32 bit executable produce reasonable output, or some bogus claim of :not an executable" -- when the 32bit loader is missing. If it runs, then you can fix your PATH by adding the location of the 32 bit executable. – ubfan1 Aug 26 '20 at 17:24
  • PATH 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 the PATH here. ldd returns nothing because it's statically linked. – rgov Aug 26 '20 at 17:32
  • what if you try running the cross compiler from whatever directory it is in with ./ – j0h Aug 26 '20 at 18:15

0 Answers0