Subject: xemacs, libjpeg and (finally) ldconfig
To: None <current-users@netbsd.org>
From: Oleg Polyanski <luke@eed.miee.ru>
List: current-users
Date: 03/07/1999 11:09:24
hello,

	about week ago i have set up linux emulation and after restarting
the piece of me, i.e. xemacs, i've discovered the problem:

dazzle p2 /home/luke 1001% xemacs
/usr/libexec/ld.so: xemacs: libjpeg.so.62.0: Inappropriate file type or format

	small investigation helped to figure out that there is a problem in
dynamic loader (to be exactly - in hash function). here is the /etc/ld.so.conf:

dazzle p2 /home/luke 1004% </etc/ld.so.conf 
/usr/pkg/lib
/usr/X11R6/lib
/usr/local/lib
/usr/lib/ifmail
/emul/linux/lib
/emul/linux/usr/lib
/emul/linux/usr/local/lib
dazzle p2 /home/luke 1005% ldd =xemacs
/usr/pkg/bin/xemacs:
        -lXaw.6 => /usr/X11R6/lib/libXaw.so.6.1 (0x40120000)
        -lpng.1 => /usr/pkg/lib/libpng.so.1.1 (0x40153000)
!!      -ljpeg.62 => not found (0x0)
	[other libs skipped]
dazzle p2 /home/luke 1006% env LD_LIBRARY_PATH=/usr/pkg/lib ldd =xemacs
/usr/pkg/bin/xemacs:
        -lXaw.6 => /usr/X11R6/lib/libXaw.so.6.1 (0x40120000)
        -lpng.1 => /usr/pkg/lib/libpng.so.1.1 (0x40153000)
!!      -ljpeg.62 => /usr/pkg/lib/libjpeg.so.62.0 (0x4016b000)
	[other libs skipped too]

	well, the ktrace output clarifies the situation:
.....
 12638 xemacs-20.4 CALL  open(0x4011d192,0,0)
 12638 xemacs-20.4 NAMI  "/emul/linux/usr/lib/libjpeg.so.62.0.0"
 12638 xemacs-20.4 RET   open 7
 12638 xemacs-20.4 CALL  read(0x7,0xefbfd668,0x20)
.....

	despite of the /usr/pkg/lib is listed first in /etc/ld.so.conf, 
ld.so tries to load libjpeg from /emul/linux/usr/lib/libjpeg.so.62.0.0,
so i guess that hash function in ld.so/ldconfig is weak.