You are not logged in.

#1 2017-09-04 10:33:52

mdiluzio
Member
Registered: 2017-09-04
Posts: 1

Recent change in ld behaviour when searching for libs within RPATH

It appears recently that some change to how ld sets up the search paths for libraries within an elf binaries RPATH has changed. I'm having trouble tracking it down, but maybe this is a known issue that others have seen as well.

For more reference, other users with the same issue on Arch and Tumbleweed can be found here on GitHub.

I'd expect to see search paths containing the current architecture (x86_64), to assist in finding architecture specific libraries for different CPU features. I'm finding the path populated with "haswell" instead, causing issues in our case with trying to run Feral Interactive games on steam.

To reproduce:
Compile a simple main.cpp "int main() { return 0; }" with the following command:
    $ g++ main.cpp -Wl,--disable-new-dtags,-rpath,\$ORIGIN/lib/

And then check the library search paths with this command:
    $ LD_DEBUG=libs ldd ./a.out

Note this kind of output:
    search path=/home/mdiluzio/lib/tls/haswell:/home/mdiluzio/lib/tls:/home/mdiluzio/lib/haswell:/home/mdiluzio/lib            (RPATH from file /home/mdiluzio/a.out)

Previously, and on distributions with older software, we see search paths containing the architecture. Without these paths programs that rely on this behavior will fail to find the required libraries that are contained in an "x86_64" sub-directory of the specified RPATH.

We think these paths should be coming from _gl_important_hwcaps in glibc's elf/dl-hwcaps.c, but haven't yet traced the root cause of change in behavior. We're unsure if the behavior of the ld search paths is not stable enough to be relied on in this way, or if this is, in fact, a configuration bug, so any help would be appreciated.

I've also reported this on the SUSE bug tracker but haven't had any response there.

EDIT: This may be a glibc issue, I've updated the SUSE bug accordingly.

Last edited by mdiluzio (2017-09-04 13:33:22)

Offline

#2 2017-09-14 11:20:06

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Recent change in ld behaviour when searching for libs within RPATH


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB