Subject: Re: SunOS emulation
To: None <port-sparc@NetBSD.ORG>
From: Greg Earle <earle@isolar.DynDNS.ORG>
List: port-sparc
Date: 05/16/2005 00:32:22
On May 15, 2005, at 11:50 PM, Laurens Vets wrote:
> I've tried to setup SunOS emulation on my SS20, but it doesn't seem to 
> work, i.e. ldd shows a missing shared library.
>
> # ldd sunos_binary
> /home/laurensv/sunos_binary:
>          -lc.1 => not found
>
> Now according to the compat_sunos manual, I need to get the shared
> libraries from a Solaris host, which I did. (I copied the whole
> /usr/lib/ dir to /emul/sunos on NetBSD).
>
> However, I still get the above output.  Is there something else I need
> to do?

Solaris libraries go in /emul/svr4, not /emul/sunos.

Also, you need the "usr/lib" tree to be under those two points;
i.e., SunOS 4.x libraries go in "/emul/sunos/usr/lib"; Solaris 2.x
libraries go in "/emul/svr4/usr/lib".

ktrace(1) is Your Friend for debugging things like this:

[0:26] isolar:~ % ldd /usr/pkg/lib/netscape/communicator-4.61/netscape
/usr/pkg/lib/netscape/communicator-4.61/netscape:
         -lc.1 => /usr/lib/libc.so.1.9
         -ldl.1 => /usr/lib/libdl.so.1.0

[0:26] isolar:~ % ktrace -d -i ldd 
/usr/pkg/lib/netscape/communicator-4.61/netscape
/usr/pkg/lib/netscape/communicator-4.61/netscape:
         -lc.1 => /usr/lib/libc.so.1.9
         -ldl.1 => /usr/lib/libdl.so.1.0

[0:26] isolar:~ % kdump | egrep libc\|libdl
   1131 netscape NAMI  "/emul/sunos/usr/lib/libc.so.1.9.1"
   1131 netscape NAMI  "/usr/lib/libc.so.1.9.1"
   1131 netscape NAMI  "/emul/sunos/usr/lib/libc.so.1.9"
   1131 netscape NAMI  "/emul/sunos/usr/lib/libc.so.1.9"
   1131 netscape NAMI  "/emul/sunos/usr/lib/libdl.so.1.0"
   1131 netscape NAMI  "/emul/sunos/usr/lib/libdl.so.1.0"
        "        -lc.1 => /usr/lib/libc.so.1.9
        "        -ldl.1 => /usr/lib/libdl.so.1.0

[0:26] isolar:~ % ls -l /emul/sunos
total 6
drwxr-xr-x  2 root  wheel  512 Feb 27  2001 dev/
drwxr-xr-x  2 root  bin    512 May  5  1998 etc/
drwxr-xr-x  6 root  wheel  512 Feb 27  2001 usr/

[0:28] isolar:~ % ls -l /emul/sunos/usr/lib/libc.so.1.9 \
/emul/sunos/usr/lib/libdl.so.1.0
-rwxr-xr-x  1 1074  bin  516096 Jul  7  1994 
/emul/sunos/usr/lib/libc.so.1.9*
-rwxr-xr-x  1 1074  bin   24576 Jan 20  1994 
/emul/sunos/usr/lib/libdl.so.1.0*

	- Greg