pkgsrc-Users archive

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

Re: pkg_install fails when archivers/xz is installed



On Tue 11 Aug 2020 at 13:29:43 +0200, Rhialto wrote:
> I did manage to create a not very complete copy of libc.so without
> SONAME, using "ld -shared -no-as-needed libc.so -o libc2.so", and when
> linking that, I got indeed
> 
> Dynamic Section:
>   NEEDED               /tmp/c/libc2.so

and the libc2.so file has

  NEEDED               libc.so.12

It occurred to me that from this result you can even today create a
hacky way to link to shared libraries with an absolute path.

For each shared lib, create a shim as above that has no SONAME. It can
link itself to the real library. Since it refers to just one, it can
have an RPATH plus basename and still only find the correct library.

Then link your program with the shim instead of the real library, and do
this by specifying the full path.  Your program will then include the
same path to the shim.

It's not ideal, but it should work.

-Olaf.
-- 
Olaf 'Rhialto' Seibert -- rhialto at falu dot nl
___  Anyone who is capable of getting themselves made President should on
\X/  no account be allowed to do the job.       --Douglas Adams, "THGTTG"

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index