Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Aug 2003 14:22:51 +0200
From:      Michael Nottebrock <michaelnottebrock@gmx.net>(by way of Michael Nottebrock <michaelnottebrock@gmx.net>)
To:        ports@freebsd.org
Subject:   Weird linking trouble, autotools/libtool experts to the rescue!
Message-ID:  <200308041423.00589.michaelnottebrock@gmx.net>

next in thread | raw e-mail | index | archive | help

--Boundary-02=_kAlL/0/8Q4dMB9o
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Description: signed data
Content-Disposition: inline

Hi,

I've been trying to update audio/libshout2 and I've been stumbling over some
very weird behaviour. In short, it builds fine on both 4-STABLE and
5.1-RELEASE, but on 4-STABLE, the shared library isn't linked to libc_r,
causing trouble when anything else tries to link it in - despite the fact
=2Dpthread seems to be present in all the needed places, except the cc -sha=
red
line, which (I think) comes from libtool.

The complete portdir is available as a tarball from
http://people.freebsd.org/~lofi/ports/libshout2.tar.gz. Below are the=20
highlights from the Makefile in src/ (after a build) and the respective lin=
es=20
with cc -shared (note the absence/presence of -pthread / -lc_r) and the lin=
es=20
from libtool that gave me the idea that this might be a libtool thing.

LIBTOOL:

archive_cmds=3D"\$CC -shared \$compile_rpath \$libobjs \$deplibs \$linkopts
\${wl}-soname \$wl\$soname -o \$lib"

archive_expsym_cmds=3D"\$CC -shared
\$compile_rpath \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname
\${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"

4-STABLE:
/bin/sh ../libtool --mode=3Dlink cc -Wall -ffast-math -fsigned-char
=2DD_THREAD_SAFE  -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include
=2Dpthread -L/usr/local/lib -o libshout.la -rpath /usr/local/lib -version-i=
nfo
3:0:0 shout.lo util.lo vorbis.lo mp3.lo net/libicenet.la
timing/libicetiming.la
avl/libiceavl.la httpp/libicehttpp.la thread/libicethread.la -L/usr/local/l=
ib
=2Dlvorbisrm -fr .libs/libshout.la .libs/libshout.* .libs/libshout.*

cc -shared shout.lo util.lo vorbis.lo mp3.lo -Wl,--whole-archive
net/.libs/libicenet.al timing/.libs/libicetiming.al avl/.libs/libiceavl.al
httpp/.libs/libicehttpp.al thread/.libs/libicethread.al
 -Wl,--no-whole-archive -L/usr/local/lib           -lvorbis      -lc=20
 -Wl,-soname -Wl,libshout.so.3 -o .libs/libshout.so.3

DEFS =3D -DHAVE_CONFIG_H
DEFAULT_INCLUDES =3D  -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS =3D
LDFLAGS =3D -pthread -L/usr/local/lib
depcomp =3D $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe =3D depfiles
DEP_FILES =3D ./$(DEPDIR)/mp3.Plo ./$(DEPDIR)/shout.Plo \
        ./$(DEPDIR)/util.Plo ./$(DEPDIR)/vorbis.Plo
COMPILE =3D $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE =3D $(LIBTOOL) --mode=3Dcompile $(CC) $(DEFS) $(DEFAULT_INCLUDES)=
 \
        $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD =3D $(CC)
LINK =3D $(LIBTOOL) --mode=3Dlink $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES =3D $(libshout_la_SOURCES)
HEADERS =3D $(noinst_HEADERS)

5.1-RELEASE:

/bin/sh ../libtool --mode=3Dlink cc -Wall -ffast-math -fsigned-char
=2DD_THREAD_SAFE  -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include
=2Dlc_r
=2DL/usr/local/lib -o libshout.la -rpath /usr/local/lib -version-info 3:0:0
shout.lo util.lo vorbis.lo mp3.lo net/libicenet.la timing/libicetiming.la
avl/libiceavl.la httpp/libicehttpp.la thread/libicethread.la -L/usr/local/l=
ib
=2Dlvorbisrm -fr .libs/libshout.la .libs/libshout.* .libs/libshout.*

cc -shared shout.lo util.lo vorbis.lo mp3.lo -Wl,--whole-archive
net/.libs/libicenet.altiming/.libs/libicetiming.al avl/.libs/libiceavl.al
httpp/.libs/libicehttpp.althread/.libs/libicethread.al -Wl,--no-whole-archi=
ve
=2DL/usr/local/lib-lc_r -lvorbis      -lc  -Wl,-soname -Wl,libshout.so.3 -o
=2Elibs/libshout.so.3

DEFS =3D -DHAVE_CONFIG_H
DEFAULT_INCLUDES =3D  -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS =3D
LDFLAGS =3D -lc_r -L/usr/local/lib
depcomp =3D $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe =3D depfiles
DEP_FILES =3D ./$(DEPDIR)/mp3.Plo ./$(DEPDIR)/shout.Plo \
        ./$(DEPDIR)/util.Plo ./$(DEPDIR)/vorbis.Plo
COMPILE =3D $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE =3D $(LIBTOOL) --mode=3Dcompile $(CC) $(DEFS) $(DEFAULT_INCLUDES)=
 \
        $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD =3D $(CC)
LINK =3D $(LIBTOOL) --mode=3Dlink $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES =3D $(libshout_la_SOURCES)
HEADERS =3D $(noinst_HEADERS)


Thanks,
=2D-
   ,_,   | Michael Nottebrock 		    | lofi@freebsd.org
 (/^ ^\) | FreeBSD - The Power to Serve     | http://www.freebsd.org
   \u/   | K Desktop Environment on FreeBSD | http://freebsd.kde.org



--Boundary-02=_kAlL/0/8Q4dMB9o
Content-Type: application/pgp-signature
Content-Description: signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iD8DBQA/LlAkXhc68WspdLARAqLzAJ0XEwVAm+JEL7w9iBHHf4ACmvXy1gCaA3Ga
WylprPKGvnq58aY0SrgRLL8=
=9tRS
-----END PGP SIGNATURE-----

--Boundary-02=_kAlL/0/8Q4dMB9o--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308041423.00589.michaelnottebrock>