Subject: Re: libvorbis using wrong library
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 10/04/2001 10:08:43
On Wed, 3 Oct 2001, Johnny Lam wrote:

> I browsed through the configure output and everything looks just fine.
> According to what I see, the build should be using only what it finds in
> /usr/pkgsrc/audio/libvorbis/.buildlink to compile and link.  Was the
> problematic build you experienced earlier caused by unusual ld.so.conf,
> LD_RUN_PATH, or LD_LIBRARY_PATH settings?  Also, what platform/version

My /etc/ld.so.conf did have /usr/local/lib above (before) /usr/pkg/lib. I
changed this and (after make clean) the error continued.

> of NetBSD are you running?

Sorry. NetBSD/i386 1.5.1_BETA 

On Thu, 4 Oct 2001, Nick Hudson wrote:

> I think this probably because of...
> 
> $ grep local /usr/pkg/bin/libtool
> sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
> sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
> 
> Could you hack libtool and remove the reference to /usr/local/lib and see if
> this helps

Okay, I modified ../libogg/work/libogg-1.0rc2/libtool to remove the
'/usr/local/lib' from three lines. Then libvorbis built clean.

I just noticed that was a symlink to /usr/pkg/bin/libtool. (Why was I
doing this as root!) Oh well. I guess I wanted to do that anyways.

But:

 $ /usr/pkg/bin/ogg123 -v acdc-who_made_who.ogg 
 Playing from file acdc-who_made_who.ogg.
 /usr/pkg/lib/libvorbisfile.so.1: Undefined PLT symbol "vorbis_packet_blocksize"
 (reloc type = 7, symnum = 56)

 $ ldd /usr/local/bin/ogg123
 /usr/local/bin/ogg123:
          -lvorbisfile => /usr/local/lib/libvorbisfile.so
          -lvorbis => /usr/local/lib/libvorbis.so
          -lm.0 => /usr/lib/libm387.so.0
          -lm.0 => /usr/lib/libm.so.0
          -logg => /usr/local/lib/libogg.so
          -lao => /usr/local/lib/libao.so
          -lossaudio.0 => /usr/lib/libossaudio.so.0
          -lc.12 => /usr/lib/libc.so.12
 $ ldd /usr/pkg/bin/ogg123
 /usr/pkg/bin/ogg123:
          -lm.0 => /usr/lib/libm387.so.0
          -lm.0 => /usr/lib/libm.so.0
          -logg.2 => /usr/pkg/lib/libogg.so.2
          -lvorbisfile.1 => /usr/pkg/lib/libvorbisfile.so.1
          -lvorbis.0 => /usr/local/lib/libvorbis.so.0
          -lao.2 => /usr/pkg/lib/libao.so.2
          -lc.12 => /usr/lib/libc.so.12

I wonder why two different (incompatible) libraries "libvorbis.so.0" have
same number so it used /usr/local/lib/libvorbis.so.0 instead of
/usr/pkg/lib/libvorbis.so.0. (These are symlinks to their 
respective libvorbis.so.0.1.)

By moving the /usr/local/lib/libvorbis.so.0 file, I was successfully able
to use the new /usr/pkg/bin/ogg123. And I was successfully able to use
/usr/local/lib/ogg123 which uses /usr/local/lib/libvorbis.so (symlink to
libvorbis.so.0.1) instead of /usr/local/lib/libvorbis.so.0.

Another workaround (with /usr/local/lib/libvorbis.so.0 in place): So I
change my /etc/ld.so.conf so /usr/pkg/lib is above /usr/local/lib and now
it works. But my old /usr/local/bin/ogg123 doesn't work anymore due to
using newer libraries.

   Jeremy C. Reed
   http://www.reedmedia.net/