Other RUNPATH in ELF binary ignored? version issue?

Hello folks,

I have very painfully managed to build the Trinity desktop (a KDE3 fork) on FreeBSD 13.1.
Only to discover that GPU support is broken in 13.1 for the (old) laptop I intended to run it on. So I had to revert to 12.4 which runs the basic X session (xterms and twm) happily. That's the reason for all the nonsense below.

Thing is, Trinity installs everything in /opt/trinity/{bin, lib, share...} and the Trinity binaries can't find their libraries under 12.4 as they do in 13.1 I have double checked and there seems to be absolutely nothing in the system configuration that adds /opt/trinity/lib to the library search path.

So it must be hardcoded in the exec file, isn't it? Yes is it:

Code:
# readelf -a /opt/trinity/bin/kolourpaint
...
Dynamic section at offset 0x1474dc contains 42 entries:
  Tag        Type                  Name/Value
 0x0000001d RUNPATH              Library runpath: [/opt/trinity/lib]
 0x00000001 NEEDED               Shared library: [libtdeprint.so.14]
 0x00000001 NEEDED               Shared library: [libtdeio.so.14]
...

So why is RUNPATH ignored when running under 12.4? Is RUNPATH something that's new to 13.x?

[Note: yes, I do realize that running something that was built on 13.1 under 12.4 is going to be a big challenge - if possible at all. I'm probably in for a world of pain, there will be missing packages etc. I know. Please let me try hacking my way along. But this library search path issue really bugs me]

Recompile everything under 12.4? not likely to succeed, the build instructions at https://wiki.trinitydesktop.org/FreeBSD_Trinity_Installation_Instructions explicitly mention FreeBSD 13 as required.
I may try this as a last resort, though. Even if I probably will have to bring in newer ports manually.

And yes of course I can set LD_LIBRARY_PATH. It's just an ugly workaround IMO (uglier that what I'm trying to achieve? open to discussion I guess :)
In the meantime if anyone has an explanation for this embedded run path ignored, kindly share it. Thanks in advance.
 
So why is RUNPATH ignored when running under 12.4? Is RUNPATH something that's new to 13.x?
It isn't. It's a feature in ELF for as long as it exists, at least as far as I know.
Recompile everything under 12.4?
Yes. It's a different ABI. FreeBSD offers backwards compatibility, not the other way around.
the build instructions at https://wiki.trinitydesktop.org/FreeBSD_Trinity_Installation_Instructions explicitly mention FreeBSD 13 as required.
Well, that's though luck then. Sorry to be straight forward here, but I guess there's no way to help ?‍♂️
And yes of course I can set LD_LIBRARY_PATH.
I very much doubt finding the libraries is the issue here, so this most likely won't help anyways.
 
Thanks for your reply.

Yeah, you're right. I'm pretty much convinced at this point that I'm going a dead end here.
Even with a lot of dirty hacks, copying over a handful of lib versions that don't exist in the 12.4 world, the best I can get are unresolved external symbols and bad system calls, so I'm giving up.

Geez, if only I could have a working X under 13.x on this machine... See my other posts.

I'll try recompiling the whole shebang under 12.4 but I expect a lot of trouble too, like port versions that don't exist in that world that I'll have to attempt building.

Wish me good luck :confused:
 
Recompile everything under 12.4? not likely to succeed, the build instructions at https://wiki.trinitydesktop.org/FreeBSD_Trinity_Installation_Instructions explicitly mention FreeBSD 13 as required.
They don't mention why though, so I assume it's just a version they tested the process with, it doesn't say 13 is a requirement. It is possible it won't work on 12.x due to some kernel or library requirement that may have been added to 13.0 and later. But if there was a technical reason why it wouldn't work on 12.x I'm sure they would have mentioned that.
 
I'll try recompiling the whole shebang under 12.4 but I expect a lot of trouble too, like port versions that don't exist in that world that I'll have to attempt building.
Adding to what SirDice already said: Ports are completely independent from base, you will have the same versions on any FreeBSD version. So, that won't be your problem.

Indeed, it can't hurt to just try. Maybe you're lucky here.

Yet another idea, 13.2 is now just a week (well, let's hope so) from release. Might also help.
 
Are you sure that you have no LD_LIBRARY_PATH set?

There are two elf tags - RUNPATH which can be overridden and RPATH which can't be overridden.

Since you mention RUNPATH, if you have a bad LD_LIBRARY_PATH then you will have problems.
 
Thanks for your reply.
No I hadn't. I double checked. Neither something set in either of the files /etc/rc.d/ldconfig reads at boot
So that's kind of a mystery.

Since then I have recompiled the whole thing under 12.4 as advised above by SirDice and zirias@ and it wasn't any more painful than I had been under 13.1 indeed (which is still painful - but the TDE people said they'lll have a full FreeBSD port ready soon)

Also I have received some advice on things worth trying to have X-Window work under 13.1 on this machine, or wait for 13.2 coming quite soon. Many tracks to explore. Exciting ;-) ... I feel young again. I used to be a heavy FreeBSD user in the late 90s/early 00s.

Now I'm ready to test Trinity on this machine at last. But that's off-topic here.
 
Back
Top