Subject: Re: COMPAT_LINUX?
To: None <port-macppc@netbsd.org>
From: Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
List: port-macppc
Date: 04/25/2001 13:32:25
SUNAGAWA Keiki <kei_sun@ba2.so-net.ne.jp> wrote:
> Andrew> /usr/pkg/lib/netscape/netscape-communicator: 1: Syntax error: "("
> Andrew> unexpected
> 
> Hmm, the symptom indicates for me that compat_linux stuff is
> not enabled in your kernel.
 
Well, there is a bogus behavior in the kernel: when running any dynamic 
executable (NetBSD natives executables have the same problem too), if the
dynamic linker is not found, the kernel tries to execute the binary as a
bourne shell script, instead of reporting an error. 

The dynamic linker path is readen from the ELF header. For Linux binaries,
it is /lib/ld.so.1 The kernel then tries /lib/ld.so.1 and 
/emul/linux/lib/ld.so.1. If both fail, the binary is executed as bourne shell
script, hence the error message described here.

The quick fix is simple: add a link from /emul/linux to 
/usr/pkg/emul/linux, or upgrade the linuxppc_lib package to the latest
version. I added the missing link in it.

The long fix would be to fix the way the kernel report errors here. I 
started talking about this on tech-kern, but it seems people are not
really interested by this issue.

-- 
Emmanuel Dreyfus
Pas de processeur Intel, pas de logiciel Microsoft:
Des programmes sains dans un ordinateur sain.
p99dreyf@criens.u-psud.fr