You are not logged in.

#1 2015-10-29 00:35:23

Malstrond
Member
From: Germany
Registered: 2009-06-03
Posts: 98

LD_PRELOAD ignored with "cannot open shared object file"

According to Nvidia's documentation you need to preload some libraries with

LD_PRELOAD="libpthread.so.0 libGL.so.1"

in order to use the

__GL_THREADED_OPTIMIZATIONS=1

feature.

But this doesn't work. When trying to start a program with them preloaded the following error gets thrown:

ERROR: ld.so: object 'libpthread.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libGL.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

I have verified that the files exist and they do (provided by (lib32-)glibc and (lib32)-nvidia-libgl respectively) and the symlinks point to the correct files that also exist. I don't think my system would be working if libpthread was gone anyway.

I'm mainly trying to use this feature for games in WINE, but the errors also get thrown when exporting the preload and then starting native applications like pacman.

Offline

#2 2015-10-29 00:54:20

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,541

Re: LD_PRELOAD ignored with "cannot open shared object file"

Doesn't LD_PRELOAD need full paths? I guess I've never tried it with libs that are in the normal linker path.

Online

#3 2015-10-29 15:20:07

Malstrond
Member
From: Germany
Registered: 2009-06-03
Posts: 98

Re: LD_PRELOAD ignored with "cannot open shared object file"

The problem is that if you use the full path, it's always wrong either for 32-bit or 64-bit binaries because you have to use /usr/lib/ and /usr/lib32 and one of them will cause an error. And if you use WINEARCH=win64 it never works because the 64-bit WINE uses both, just like Windows (both errors "wrong ELF class: ELFCLASS64" and "wrong ELF class: ELFCLASS32" appear). Using only the filename is supposed to to pick the correct one if the path is in /etc/ld.so.conf.d/.
The Arch Wiki for WINE and various guides online do it that way too.

Last edited by Malstrond (2015-10-29 15:24:06)

Offline

Board footer

Powered by FluxBB