tech-pkg archive

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

Re: and mysterious build errors

On Sun 23 Oct 2022 at 16:34:03 +0200, Havard Eidnes wrote:
> At this point there are at least two ways forwards that i can
> see:
> 1) It's an operator error to let old libraries lay around
>    (or perhaps specifically*), and I should just remove
>    those and proceed with life.

It has been my policy for a while (just because of incompatible changes
in the C++ libraries) that if I have to compile one package with a newer
gcc, I delete all packages and recompile them with the same gcc. I
usually rebuild my chroot environment for this occasion to make sure it
is clean.

This is probably only strictly needed if there is C++ involved, but it's
an easier and more consistent policy to just use the same gcc for

> 2) Find a way to put the library directory of gcc (in this case
>    /usr/pkg/gcc10/lib) earlier in the RPATH.  This should preferably
>    be done in a robust and "pkgsrc-ish" way.

Many years ago I used a FreeBSD system where I had 2 different gcc
versions installed. They had the same library names, but they were not
compatible. Of course, one of them was first in the system-wide search
path. So, programs compiled with the other version were suddenly
mysteriously broken.  It cost me some time to find out what was going

This event has brought me to crusade against library search paths.
System-wide (like in FreeBSD or Linux) they are clearly no good. But
per-executable (like we have with NetBSD's --rpath) is also not good
enough. It can still cause the wrong version of a library to be used.

ELF actually supports storing full paths to shared libraries, but our
tools strip the path if it is given. I did some experiments with
creating executables with full dependency paths, and with some tricks
this is already possible. It would however be nicer if the tools didn't
work against us here.

___ "Buying carbon credits is a bit like a serial killer paying someone else to
\X/  have kids to make his activity cost neutral." -The BOFH

Attachment: signature.asc
Description: PGP signature

Home | Main Index | Thread Index | Old Index