[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libtool hell / stupid relinking during `make fake`



Hi,


first of all, this is not a problem report about anything official in
-current/OpenBSD 3.4. No worries. :)

The Xiph.org CVS had lots of activity lately, with new versions for Ogg
Vorbis & Co. ... libao-0.8.4, libogg-1.1, libvorbis-1.0.1 and
vorbis-tools-1.0.1. Those things are still far from being officially
released, however, I wanted to make an unofficial upgrade of my ports.
It was an interesting exercise...

I fetched the sources via CVS and did a `make dist` with each package to
get a nice tarball that I can throw into /usr/ports/distfile, make
makesum, make extract, update the patches, PLIST and PFRAG, etc pp,
jadda jadda jadda. All this is not a big deal, except with
libvorbis(file), which is extremely good at triggering libtool bugs. It
all depends on who `make dist`'ed the tarball. When I do it on OpenBSD
with libtool 1.3.5, libvorbisfile won't link under no circumstances.
When I install libtool-1.4.3 or -1.5 (or use a Linux box that has these
installed, makes no difference), it actually builds but then falls apart
during `make fake` - libtool wants to relink libvorbisfile against
/usr/local/lib/libvorbis.so.meversion (which doesn't exist, yet) and the
whole thing bails out.

On http://www.openbsd.org/porttest.html we have "GNU libtool
occasionally has trouble relinking libraries during the fake process on
some architectures." Exactly. The question is, how to solve this
problem. I was prodding and poking at libvorbis' ltmain.sh trying to
find out why it would do such a stupid thing, without success (I
searched the web, archives and other ports and tried every
ltmain.sh-change I could find that might remotely have something to do
with my relinking problem) ... in the end I simply patched the whole
relinking-feature out of it, and tadaa, it installed. vorbis-tools,
which I updated afterwards, linked and works fine with my raped
libvorbis.

This is OBSD-current as of two days ago on i386, btw, nothing exotic.

My question is whether there is a more elegant solution to this. Or
rather, a solution that doesn't feel like a lobotomy and that is
guaranteed to work on all platforms. This libtool attempt to relink only
happens within the ports infrastructure - building and installing the
tarball by hand works quite well. SEPARATE_BUILD settings and configure
parameters like --disable-fast-install / --enable-fast-install had no
effect.

Any hints, suggestions, pointers etc are highly appreciated. Also, if
someone has an idea what might cause libtool 1.3.5 not to link something
in the first place and how to work around this bug, any off-list replies
on that would be very helpful as well.


Thanks,

Moritz

P.S.: The libtool error messages are as follows:

tarball made with libtool-1.3.5 on OpenBSD (showstopper both within and
without the ports tree, works on Linux but is probably not OpenBSD's
fault either... more like a libtool bug on OBSD). This is during a
`gmake build`:
/bin/sh ../libtool --mode=link gcc -fsigned-char -DUSE_MEMORY_H -o
libvorbisfile.la -rpath /usr/local/lib -no-undefined -version-info 4:0:1
vorbisfile.lo libvorbis.la -lm -L/usr/local/lib -logg
libtool: link: error: cannot link shared libraries into libtool
libraries

tarball made with libtool-1.5 on Linux; builds fine but fails with
pointless relinking during `make fake`. I inserted "-=-"s on newlines to
make it more readable with all the wrapping:
===>  Faking installation for libvorbis-1.0.1
Making install in lib
Making install in modes
Making install in books
Making install in coupled
Making install in uncoupled
Making install in floor
/bin/sh
/usr/ports/audio/libvorbis/w-libvorbis-1.0.1/libvorbis-1.0.1/mkinstalldirs
/usr/ports/audio/libvorbis/w-libvorbis-1.0.1/fake-i386/usr/local/lib
-=-
 /bin/sh ../libtool --mode=install /usr/bin/install -c -o root -g bin 
libvorbis.la
/usr/ports/audio/libvorbis/w-libvorbis-1.0.1/fake-i386/usr/local/lib/libvorbis.la
-=-
/usr/bin/install -c -o root -g bin .libs/libvorbis.so.3.0
/usr/ports/audio/libvorbis/w-libvorbis-1.0.1/fake-i386/usr/local/lib/libvorbis.so.3.0
-=-
/usr/bin/install -c -o root -g bin .libs/libvorbis.lai
/usr/ports/audio/libvorbis/w-libvorbis-1.0.1/fake-i386/usr/local/lib/libvorbis.la
-=-
/usr/bin/install -c -o root -g bin .libs/libvorbis.a
/usr/ports/audio/libvorbis/w-libvorbis-1.0.1/fake-i386/usr/local/lib/libvorbis.a
-=-
ranlib -t
/usr/ports/audio/libvorbis/w-libvorbis-1.0.1/fake-i386/usr/local/lib/libvorbis.a
-=-
chmod 644
/usr/ports/audio/libvorbis/w-libvorbis-1.0.1/fake-i386/usr/local/lib/libvorbis.a
-=-
libtool: install: warning: remember to run `libtool --finish
/usr/local/lib'
-=-
 /bin/sh ../libtool --mode=install /usr/bin/install -c -o root -g bin 
libvorbisfile.la
/usr/ports/audio/libvorbis/w-libvorbis-1.0.1/fake-i386/usr/local/lib/libvorbisfile.la
-=-
libtool: install: warning: relinking `libvorbisfile.la'
-=-
(cd /usr/ports/audio/libvorbis/w-libvorbis-1.0.1/build-i386/lib; /bin/sh
../libtool --mode=relink cc -fsigned-char -O2 -DUSE_MEMORY_H -o
libvorbisfile.la -rpath /usr/local/lib -no-undefined -version-info 4:0:1
vorbisfile.lo libvorbis.la -lm -L/usr/local/lib -logg -inst-prefix-dir
/usr/ports/audio/libvorbis/w-libvorbis-1.0.1/fake-i386)
-=-
cc -shared  -fPIC -DPIC -o .libs/libvorbisfile.so.4.0 
.libs/vorbisfile.o  -L/usr/local/lib /usr/local/lib/libvorbis.so.3.0 -lm
/usr/local/lib/libogg.so.5.0 
-=-
cc: /usr/local/lib/libvorbis.so.3.0: No such file or directory
-=-
libtool: install: error: relink `libvorbisfile.la' with the above
command before installing it
*** Error code 1
[...]

The patch that "fixes" this, for a libtool-1.5-generated ltmain.sh is
attached.
--- ltmain.sh.orig      Sat Sep 13 16:34:54 2003
+++ ltmain.sh   Sat Sep 13 16:36:28 2003
@@ -5367,20 +5367,8 @@
            exit 1
          fi
 
-         if test -n "$inst_prefix_dir"; then
-           # Stick the inst_prefix_dir data into the link command.
-           relink_command=`$echo "$relink_command" | $SED "s%_(_at_)_inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
-         else
-           relink_command=`$echo "$relink_command" | $SED "s%_(_at_)_inst_prefix_dir@%%"`
-         fi
+         relink_command=
 
-         $echo "$modename: warning: relinking \`$file'" 1>&2
-         $show "$relink_command"
-         if $run eval "$relink_command"; then :
-         else
-           $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
-           exit 1
-         fi
        fi
 
        # See the names of the shared library.







Visit your host, monkey.org