I sometimes get this error when compiling a program:
make[1]: /usr/bin/perl: Command not found
make[1]: *** [links] Error 127
This happens with any program that requires perl to compile, such as openssl and automake. However:
sh-2.05b# perl -v
This is perl, v5.10.0 DEVEL34342 built for arm-linux-thread-mu开发者_Go百科lti
(with 1 registered patch, see perl -V for more detail)
sh-2.05b# /usr/bin/perl -v
This is perl, v5.10.0 DEVEL34342 built for arm-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)
I definitely have perl installed. What's going on?
If this is reproducible, run the make
command with strace -f
, to see unambiguously which command is attempting (and failing) to exec.
I can recall from my own experience the following two situations in which an exec
-family might fail on Linux with ENOENT
despite that the command is actually there:
- The
.interp
referred to by the binary isn't present (example: the LSB-compatible binary refers to/lib/ld-lsb.so.3
instead of the usual/lib/ld-linux.so.2
, and LSB compatibility packages haven't been installed on the Linux machine). Seems unlikely in your scenario :) - Some kernel-level non-standard security mechanism is in place which is blocking execution of the binary - especially on locked-down embedded devices. One would think
EACCES
would be the more logical errno in this case, but maybeENOENT
is used to prevent leaking information about the existence of binaries to unprivileged processes.
精彩评论