Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Mar 2019 13:54:12 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 236734] devel/libtool: C++ libraries are linked with -nostdlib
Message-ID:  <bug-236734-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236734

            Bug ID: 236734
           Summary: devel/libtool: C++ libraries are linked with -nostdlib
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: tijl@FreeBSD.org
          Reporter: rakuco@FreeBSD.org
             Flags: maintainer-feedback?(tijl@FreeBSD.org)
          Assignee: tijl@FreeBSD.org

When C++ libraries are built with libtool, they are linked with -nostdlib by
default, which then causes flags such as -pthread to be ignored, resulting =
in
shared libraries that do not have all necessary DT_NEEDED entries.

This happens to graphics/ilmbase, where libIlmThread.so is linked with
-nostdlib -pthread and ends up not linking against libthr.so. With the rece=
nt
work in HEAD to make lld use --no-allow-shlib-undefined by default when lin=
king
executables, we end up with failures like the one in graphics/krita
(http://beefy12.nyi.freebsd.org/data/head-amd64-default/p496405_s345355/log=
s/krita-4.1.8_1.log):

ld: error: /usr/local/lib/libIlmThread.so: undefined reference to
pthread_create
c++: error: linker command failed with exit code 1 (use -v to see invocatio=
n)

There are some old reports from Linux distros complaining about the same
problem: https://bugzilla.redhat.com/show_bug.cgi?id=3D661333 and
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D468555

Distros have since just started patching ilmbase to make it use -lpthread
instead of -pthread when linking:
https://git.archlinux.org/svntogit/packages.git/tree/trunk/ilmbase-2.0.1-no=
_undefined.patch?h=3Dpackages/ilmbase
and
https://salsa.debian.org/debian-phototools-team/ilmbase/blob/master/debian/=
rules#L29,
for example.

I wonder if we should change the libtool port, or just start patching ilmba=
se
as well.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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