Subject: SunOS 4 shared libraries from Solaris 7 cdrom
To: None <port-sparc@netbsd.org>
From: Brad Spencer <brad@anduin.eldar.org>
List: port-sparc
Date: 11/10/1999 21:23:58
Making note of the various messages lately about SunOS 4 shared libraries,
I took a look at my Solaris 7 cd with the theory in mind that NetBSD seems
to emulate nearly everyone.  It appears to contain some of the needed
libraries, especially in the SUNWbcp package.  There is even a ld.so and
ld.so.1 loader in usr/lib.  However, it drops core with an unimplemented
system call.  The ktrace is:

 26709 ktrace   RET   ktrace 0
 26709 ktrace   CALL  execve(0xeffff73f,0xeffff6c8,0xeffff6d0)
 26709 ktrace   NAMI  "./ldd"
 26709 ldd      EMUL  "sunos"
 26709 ldd      RET   execve JUSTRETURN
 26709 ldd      CALL  open(0x21ec,0,0x3160)
 26709 ldd      NAMI  "/emul/sunos/usr/lib/ld.so"
 26709 ldd      NAMI  "/emul/sunos"
 26709 ldd      NAMI  "/emul/sunos/usr/lib/ld.so"
 26709 ldd      RET   open 3
 26709 ldd      CALL  read(0x3,0xeffff64c,0x20)
 26709 ldd      GIO   fd 3 read 32 bytes
       "\M^A\^C\^A\v\0\0 \0\0\0 \0\0\0\0\0\0\0\^CT\0\0\0 \0\0\0\0\0\0\0\0"
 26709 ldd      RET   read 32/0x20
 26709 ldd      CALL  mmap(0,0x4000,0x5,0x80000002,0x3,0)
 26709 ldd      RET   mmap 268500992/0x10010000
 26709 ldd      CALL  mmap(0x10012000,0x2000,0x7,0x80000012,0x3,0x2000)
 26709 ldd      RET   mmap 268509184/0x10012000
 26709 ldd      CALL  open(0x21fb,0,0x7)
 26709 ldd      NAMI  "/emul/sunos/dev/zero"
 26709 ldd      NAMI  "/dev/zero"
 26709 ldd      RET   open 4
 26709 ldd      CALL  close(0x3)
 26709 ldd      RET   close 0
 26709 ldd      CALL  rmdir(0x6)
 26709 ldd      RET   rmdir -1 errno 14 Bad address
 26709 ldd      CALL  open(0x10012184,0,0x7)
 26709 ldd      NAMI  "/emul/sunos/usr/lib/ld.so.1"
 26709 ldd      NAMI  "/emul/sunos"
 26709 ldd      NAMI  "/emul/sunos/usr/lib/ld.so.1"
 26709 ldd      RET   open 3
 26709 ldd      CALL  #28 (unimplemented sunos_fstat)
 26709 ldd      PSIG  SIGSYS SIG_DFL
 26709 ldd      NAMI  "ldd.core"

Assuming that the it really did want system call 28, then the description
is correct.  NetBSD does not emulate sunos_fstat.  I presume that someone
knows the difference between this fstat and system call 62, the one that
maps to compat_43_fstat.  Of course, there may certainly be other trouble,
even if this particular one is delt with.  Another note...  system call 28
in the SVR4 emulation is also a fstat call, don't know they are related.
[calls 27-32 are the same ideas in sunos and svr4, so they are
probably the same].

I am not really sure how to fix this myself, or even if it is possible to
make the libraries from the Solaris 7 disk work.  I can, however, test any
patches that might become available.


Brad Spencer - brad@anduin.eldar.org   http://anduin.eldar.org
[finger brad@anduin.eldar.org for PGP public key]