tech-pkg archive

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

Re: gcc*-libs help needed: rpath needs fixing



On Mon 02 Sep 2024 at 19:12:40 +0200, Thomas Klausner wrote:
> On Mon, Sep 02, 2024 at 06:11:18PM +0200, Rhialto wrote:
> > Another thing I noticed in my installation, was that packages compiled
> > with the gcc12 package, and then installed on my laptop without gcc12
> > but with gcc12-libs, still didn't find some of the libraries.  The RPATH
> > built into the using packages seemed to be incorrect.
> > 
> > I wanted to look deeper into it to see if it was some kind of operator
> > error or what, but for this case I want to mention it.
> > 
> > For example, /usr/pkg/bin/pan (from news/pan) has as RPATH
> > 
> > /usr/pkg/gcc12/x86_64--netbsd/lib/.
> 
> This looks like the gcc12-libs path corresponding to
> /usr/pkg/gcc12/lib in the gcc12 package.
> 
> > /usr/pkg/gcc12/lib/gcc/x86_64--netbsd/12.3.0
> 
> This is a different path with different files from the gcc12 package.
> The gcc12-libs equivalent would be
> /usr/pkg/gcc12/x86_64--netbsd/lib/gcc/x86_64--netbsd/12.3.0 but only
> the 'plugin' directory below that contains libraries (in both
> packages).
> 
> So this looks to me like the original rpath rewrite was incomplete,
> because it left this path alone.

I tried to find out where these paths come from. I found
lang/gcc12-libs/buildlink3.mk (included from mk/compiler/gcc.mk) which
creates a gcc specs fine if USE_PKGSRC_GCC_RUNTIME is set to yes.
.cwrapper/specs.libgcc contains (when building news/pan):

*link_libgcc:
%D -R/usr/pkg/gcc12/x86_64--netbsd/lib/%M

which explains the first (and correct) path.

I went to look for the failing binaries, and I found some that use
libgomp, for example links, mkvextract, mkvinfo, mkvmerge.

gcc12-libs: /usr/pkg/gcc12/x86_64--netbsd/lib/libgomp.so.1
gcc12:      /usr/pkg/gcc12/lib/libgomp.so.1

Looking at mkvinfo:

$ mkvinfo
/usr/pkg/lib/libb2.so.1: Shared object "libgomp.so.1" not found

$ objdump -x /usr/pkg/lib/libb2.so.1 | grep PATH
  RPATH                /usr/pkg/gcc12//lib/.:/usr/pkg/gcc12/lib/.:/usr/pkg/gcc12/lib/gcc/x86_64--netbsd/12.3.0:/usr/pkg/lib

Ahh.... libb2 is *missing* our path from gcc12-libs for some reason.
It didn't build a .cwrapper/specs.libgcc file. I have not traced yet why
not.

For links (www/links-gui) the dependency on libgomp is direct, and it is
equally missing the correct RPATH; it looks a lot like the RPATH of
libb2 with /usr/X11R7/lib added.

So if there are 2 broken packages there may be more.

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert                            <rhialto/at/falu.nl>
\X/ There is no AI. There is just someone else's work.           --I. Rose

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index