3

I've got a Rust build script that I need to run for a project that I'm contributing to. Cargo attempts to execute the script before the main build process but fails, so I tried running it:

$ ./build-script-build
bash: ./build-script-build: No such file or directory

However, the file clearly exists:

$ file build-script-build
build-script-build: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld64.so.1, not stripped

And I have permissions:

$ stat -c %A build-script-build
-rwxr-xr-x

strace shows the following:

$ strace ./build-script-build
execve("./build-script-build", ["./build-script-build"], [/* 23 vars */]) = -1 ENOENT (No such file or directory)
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
write(2, "strace: exec: No such file or di"..., 40) = 40
exit_group(1)                           = ?
+++ exited with 1 +++

I know this issue can crop up with 32-bit executables on 64-bit systems, but file shows that it's 64-bit. What am I missing?

This is on Linux 4.8.13-1-ARCH x86_64, by the way.

Mac O'Brien
  • 131
  • 2
  • I'm curious: what happens if you 1. run strace with the full path, 2. move and run from another location (e.g., /tmp)? – sage Dec 27 '17 at 17:55
  • See [this](https://superuser.com/q/248512/432690) and [this](https://stackoverflow.com/q/1562071/10765659). I guess in your case `/lib/ld64.so.1` doesn't exist. You should make it a symlink to the right interpreter (compare [this comment](https://superuser.com/q/248512/432690#comment256662_248530)). What is the output of `ldd build-script-build`? – Kamil Maciorowski May 11 '19 at 20:14

0 Answers0