Subject: Perl/Tk
To: None <port-arm32@netbsd.org>
From: Neil Hoggarth <neil.hoggarth@physiol.ox.ac.uk>
List: port-arm32
Date: 08/24/1998 21:05:13
Hi folks!

Is anyone out there successfully using Perl/Tk on NetBSD/arm32? (or
having notable lack of success?). pTk used to work okay for me under
1.2G on my RiscPC. I've had problems ever since I went to the UVM
snapshot a few months back. I hesitated to mention it then, because
my X11 setup was a bit of a mess, but I'm now finding the same thing
on a cleanly setup CATS system.

I'm using Perl and pTk built out from a current (as of a week or so
back) pkgsrc. All pTk scripts die on startup with the error:

/usr/libexec/ld.so: Undefined symbol "_XAllocClassHint" in perl:/usr/pkg/lib/perl5/site_perl/arm32-netbsd/auto/Tk/Tk.so

ld.so.conf does include /usr/X11R6/lib, and dynamically linked X
binaries work okay otherwise.

Other Perl modules seem to work okay, but I'm not sure how much dynamic
loading (if any) the ones that I'm successfully using do.

If anyone has any hints or suggestions for other things to try then let
me know.

I used ktrace/kdump to try and figure out why the X shared library
wasn't being found, and to my suprise I found that Perl did seem to be
finding and loading the relevent shared object (if I read the kdump
output right). To finish with, I enclose some snippits from the kdump
output, in case they mean something to someone more wizardly than I!

   150 perl     NAMI  "/usr/pkg/lib/perl5/site_perl/arm32-netbsd/auto/Tk/Tk.so"
   150 perl     RET   open 4
   150 perl     CALL  read(0x4,0xefbfd3c4,0x20)
   150 perl     GIO   fd 4 read 32 bytes
       "\M-@\M^O\^A\v\0\M^P\^N\0\0\^P\^A\0\M-D\^]\^A\0\M-|\M-7\^C\0 \0\0\0\0\0\
        \0\0\0\0\0\0"
   150 perl     RET   read 32/0x20
   150 perl     CALL  mmap(0,0x10bdc4,0x5,0x4,0x4,0,0,0)
   150 perl     RET   mmap 269832192/0x10155000
   150 perl     CALL  mprotect(0x1023e000,0x11000,0x7)
   150 perl     RET   mprotect 0
   150 perl     CALL  mmap(0x1024f000,0x11dc4,0x7,0x1014,0xffffffff,0,0,0)
   150 perl     RET   mmap 270856192/0x1024f000
   150 perl     CALL  close(0x4)
   150 perl     RET   close 0

I read that as finding and mapping in the autosplit Tk library thingy.

   150 perl     CALL  open(0x10085e30,0,0)
   150 perl     NAMI  "/var/run/ld.so.hints"
   150 perl     RET   open 4
   150 perl     CALL  __fstat13(0x4,0xefbfd2d8)
   150 perl     RET   __fstat13 0
   150 perl     CALL  mmap(0,0x2000,0x1,0x4,0x4,0,0,0)
   150 perl     RET   mmap 269086720/0x1009f000
   150 perl     CALL  open(0x100a011a,0,0)
   150 perl     NAMI  "/usr/X11R6/lib/libX11.so.6.1"
   150 perl     RET   open 6
   150 perl     CALL  read(0x6,0xefbfd398,0x20)
   150 perl     GIO   fd 6 read 32 bytes
       "\M-@\M^O\^A\v\0`
        \0\0p\0\0\0\0\0\0\M-|\M-/\^B\0 \0\0\0\0\0\0\0\0\0\0\0"
   150 perl     RET   read 32/0x20
   150 perl     CALL  mmap(0,0xad000,0x5,0x4,0x6,0,0,0)
   150 perl     RET   mmap 270929920/0x10261000
   150 perl     CALL  mprotect(0x10307000,0x7000,0x7)
   150 perl     RET   mprotect 0
   150 perl     CALL  mmap(0x1030e000,0,0x7,0x1014,0xffffffff,0,0,0)
   150 perl     RET   mmap 271638528/0x1030e000
   150 perl     CALL  close(0x6)
   150 perl     RET   close 0

I read that as finding and mapping libX11.so - and nm tells me that
this file does export _XAllocClassHint, *but*:

   150 perl     CALL  sysarch(0,0xefbfd37c)
   150 perl     RET   sysarch 0
   150 perl     CALL  write(0x2,0xefbfcdfc,0x14)
   150 perl     GIO   fd 2 wrote 20 bytes
       "/usr/libexec/ld.so: "
   150 perl     RET   write 20/0x14
   150 perl     CALL  write(0x2,0xefbfce18,0x64)
   150 perl     GIO   fd 2 wrote 100 bytes
       "Undefined symbol "_XAllocClassHint" in
perl:/usr/pkg/lib/perl5/site_pe\
        rl/arm32-netbsd/auto/Tk/Tk.so
       "

I've no real idea about what has gone wrong here. sysarch 0 seems to be
"synchronize the instruction cache" but I'm not sure if this is part of
what is going wrong, part of what ought be going on, or part of
generating the message to stderr!

Regards,

+-------------------------------------------------------------------------+
Neil Hoggarth                                 Departmental Computer Officer
<neil.hoggarth@physiol.ox.ac.uk>                   Laboratory of Physiology
http://www.physiol.ox.ac.uk/~njh/                     Oxford University, UK
+-------------------------------------------------------------------------+