compiling shared library with already-built library (libvglfaker.so)

Hello,

This is a bit of a long shot. This is related to https://forums.opensuse.org/showthread.php/548118-nVidia-Cuda-Bumblebee-Codecs-quot-Recipe-quot-not-working-on-openSUSE-15-2

I discovered that the /usr/lib64/libvglfaker.so in LEAP 15.2 and TW are compiled without links to libGLX or libGLdispatch. Right now, the work around is to use the libvglfaker from LEAP 15.1 but I want to recompile the libvglfaker.so provided by VirtualGL in LEAP 15.2 repository.

Working15.1 libvglfaker.so:

ldd /usr/lib64/libvglfaker.so
        linux-vdso.so.1 (0x00007fff9eaf5000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007ff3da73c000)
        libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007ff3da4ab000)
        libturbojpeg.so.0 => /usr/lib64/libturbojpeg.so.0 (0x00007ff3da23a000)
        libXv.so.1 => /usr/lib64/libXv.so.1 (0x00007ff3da034000)
        libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007ff3d9cf3000)
        libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007ff3d9ae1000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff3d98c2000)
        libm.so.6 => /lib64/libm.so.6 (0x00007ff3d958a000)
        libc.so.6 => /lib64/libc.so.6 (0x00007ff3d91cf000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff3dabf4000)
        libGLX.so.0 => /usr/lib64/libGLX.so.0 (0x00007ff3d8f9d000)
        libGLdispatch.so.0 => /usr/lib64/libGLdispatch.so.0 (0x00007ff3d8ce7000)
        libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007ff3d8abe000)
        libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007ff3d88ba000)

not working 15.2/TW libvglfaker.so

ldd /usr/lib64/libvglfaker.so.back
 linux-vdso.so.1 (0x00007f58ab51c000)
 libdl.so.2 => /lib64/libdl.so.2 (0x00007f58ab3fd000)
 libturbojpeg.so.0 => /usr/lib64/libturbojpeg.so.0 (0x00007f58ab35e000)
 libXv.so.1 => /usr/lib64/libXv.so.1 (0x00007f58ab356000)
 libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f58ab211000)
 libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f58ab1fc000)
 libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f58ab1da000)
 libm.so.6 => /lib64/libm.so.6 (0x00007f58ab092000)
 libc.so.6 => /lib64/libc.so.6 (0x00007f58aaec7000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f58ab51e000)
 libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f58aae9c000)
 libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f58aae97000)

I don’t want to go as far as to re-compiling VirtualGL from source (another issue with Turbo-Jpeg) and I’ve already confirmed this bug https://bugzilla.opensuse.org/show_bug.cgi?id=1176422

I am trying to compile just this library as a “cheap” solution. I tried compiling with (so.back is the original TW library)

gcc -shared -Wl, /usr/lib64/libvglfaker.so.back /lib64/libdl.so.2 /usr/lib64/libGL.so /usr/lib64/libturbojpeg.so.0 /usr/lib64/libXv.so.1 /usr/lib64/libX11.so.6 /usr/lib64/libXext.so.6 /lib64/libpthread.so.0 /lib64/libm.so.6 /lib64/libc.so.6 /lib64/ld-linux-x86-64.so.2 /usr/lib64/libGLX.so.0 /usr/lib64/libGLdispatch.so /usr/lib64/libxcb.so.1  -o ./libvglfaker.so

links are correct


linux-vdso.so.1 (0x00007ffe9d1d6000)
        libvglfaker.so (0x00007fbfa4f09000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fbfa4ed2000)
        libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007fbfa4e46000)
        libturbojpeg.so.0 => /usr/lib64/libturbojpeg.so.0 (0x00007fbfa4da7000)
        libXv.so.1 => /usr/lib64/libXv.so.1 (0x00007fbfa4d9f000)
        libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007fbfa4c5a000)
        libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007fbfa4c43000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fbfa4c21000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fbfa4adb000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fbfa4910000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fbfa4f15000)
        libGLX.so.0 => /usr/lib64/libGLX.so.0 (0x00007fbfa48de000)
        libGLdispatch.so.0 => /usr/lib64/libGLdispatch.so.0 (0x00007fbfa4826000)
        libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007fbfa47f9000)
        libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007fbfa47f4000)

but obviously compiled libvglfaker.so is not the right size or length and and it does not work and is missing the simplest package.

libdlfaker.so: undefined symbol: _vgl_dlopen

Is there a way to re-compile a pre-compiled shared libraries provided by Zypper with more linkers?

Maybe update to 2.6.5 will solve this problem?

Fixed an oversight whereby the addresses of the interposed glDrawBuffers(), glGetString(), and glGetStringi() functions introduced in 2.6.3[2] and 2.6.4[1] were not returned from the interposed glXGetProcAddress() and glXGetProcAddressARB() functions.

I am not opposed to the upgrade, and I am sure it will fix the issue, and I hope based on the bug report the developers will push it in the next update. There’s a separate issue when I try to compile VirtualGL directly from their source git, OpenSUSE is missing the include shared header for turbojpeg. I guess rpm from the sourceforge should be good enough.

In any case, is there any way to recompile a comiled shared library without the source code? I know that for smaller codes, we can link pretty much any packages with anything without the source code.

Furthermore, where would be the source code be for this specific source code be as long as zypper is concerned?

Is there any reason why this VirtualGL shouldn’t be used instead of the official Leap 15.2/TW version? It seems to be mained more frequently.

Hi
It will, thought you might want to try it out before it’s released…

Cannot find it in openSUSE Software .

Community repo from some person.

Hi
Branches on OBS are for maintenance, not normally available in search since by default it doesn’t publish. Need an OBS account to download though (or use osc getbinaries).

Yes, I just checked out his page (Install package home:dirkmueller:branches:X11:Bumblebee / VirtualGL) and it’s registered on the software website. Also his packages are not digitally signed and YAST refuses to allow his repository to be added

https://build.opensuse.org/package/binary/download/home:dirkmueller:branches:X11:Bumblebee/VirtualGL/openSUSE_Tumbleweed/x86_64/

Honestly, I hope his build merges with main release VGL because I cannot really recommend something like this in a set of instructions or recommend to someone but the build VGL is also broken.

Hi
Some person? A contributor…


rpm -qa --changelog | grep "dmueller" | wc -l
2926

It is possible to get code in assembly language. Then it is possible to convert it to (bad) C/C++.
Make your changes, compile, use.
But for what? You have source code with a free license, responding developers, bug trackers, etc. …

Good points, but as I said, this is for a “cheap” solution. Doing the least amount of work to get most. Obviously if this doesn’t lead to quick clean solution, I’ll pursue another option. In this case is really requesting the factory VirtualGL to be updated as soon as possible, this is an issue for LEAP 15.2 and TW.

Test for VirtualGL 2.6.5 + bug report?

Will do but it will take some time… Holiday season.

Just checked the experimental X11:bumblebee repos. Still no good.

libvglfaker.so from experimental bumbleee:

Dec 24 10:18 /usr/lib64/libvglfaker.so
ldd /usr/lib64/libvglfaker.so      
        linux-vdso.so.1 (0x00007fff7e75d000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f089eee9000)
        libturbojpeg.so.0 => /usr/lib64/libturbojpeg.so.0 (0x00007f089ee4a000)
        libXv.so.1 => /usr/lib64/libXv.so.1 (0x00007f089ee42000)
        libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f089ecfd000)
        libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f089ece8000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f089ecc6000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f089eb7e000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f089e9b3000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f089f00c000)
        libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f089e988000)
        libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f089e983000)

Still missing the proper linkers for CUDA to work.

Will put in bug report.

Instead of a new bugreport, I updated the existing bugreport shared before. https://bugzilla.opensuse.org/show_bug.cgi?id=1176422

I’ve also assigned the bug to Dirk Mueller in Bugzilla, I hope he doesn’t mind. It’ll literally be just 2 extra linkers to add in the compiler.