Subject: LD_PRELOAD and firefox-bin-linux
To: None <tech-pkg@NetBSD.org>
From: =?UTF-8?Q?C=C3=A9sar_Catri=C3=A1n?= C. <ccatrian@eml.cc>
List: tech-pkg
Date: 07/06/2005 17:43:24
Hello

I am trying to get audiooss to work for use with NAS for firefox and flash plugin,
by installing libnas and audiooss in RPMS into the linux emulation tree, using
firefox and libs from pkgsrc.

The audiooss lib is used as a client for a NAS server, for all applications that
make use of OSS.

I am not sure about the right way to preload the library. In linux is just

$ LD_PRELOAD=/location/libaudiooss.so exec firefox

but I can't get it to work using our linux emulation layer.

$ LD_PRELOAD=/emul/linux/usr/lib/audiooss/libaudiooss.so /emul/linux/bin/sh /usr/pkg/bin/firefox-gtk2-linux 
Shared object "libaudio.so.2" not found

$ ls -l /emul/linux/usr/X11R6/lib/libaudio.so.2
lrwxr-xr-x  1 root  wheel  15 Jul  5 14:36 /emul/linux/usr/X11R6/lib/libaudio.so.2 -> libaudio.so.2.3
cetrox@core $ ls -l /emul/linux/usr/X11R6/lib/libaudio.so.2.3
-rwxr-xr-x  1 root  wheel  90376 Jul  5 14:36 /emul/linux/usr/X11R6/lib/libaudio.so.2.3

If I add the paths /emul/linux/usr/X11R6/lib and /emul/linux/lib to the LD_LIBRARY_PATH 
variable the operation ends with a segmentation fault.

$ LD_PRELOAD=/emul/linux/usr/lib/audiooss/libaudiooss.so /emul/linux/bin/sh /usr/pkg/bin/firefox-gtk2-linux
zsh: segmentation fault  LD_PRELOAD=/emul/linux/usr/lib/audiooss/libaudiooss.so /emul/linux/bin/sh

Which is the right way to go?

Thanks in advance.

César Catrián C.