Bug 1440124 - undefined reference to `_glapi_tls_Current'
Summary: undefined reference to `_glapi_tls_Current'
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: libglvnd
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nicolas Chauvet (kwizart)
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-07 10:53 UTC by N.Brack
Modified: 2017-04-19 10:00 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-04-10 10:56:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Output of dnf list available 'xorg-x11-drv-nvidia*' (2.11 KB, text/plain)
2017-04-19 09:40 UTC, N.Brack
no flags Details

Description N.Brack 2017-04-07 10:53:22 UTC
I'm currently trying to build, under Fedora 25, a large (proprietary) software that uses OpenGL.  That software used to build so far.  However, the build fails at the link step, with the following error :

    /usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../lib64/libGL.so: undefined reference to `_glapi_tls_Current'

However the symbol is define in libGLdispatch.so, as the following bash loop executed in /usr/lib64 shows :

    $ for f in *.so; do nm -D $f 2>/dev/null | grep -i glapi_tls_Current | awk '{print "'$f':" $0}'; done
    libGLdispatch.so:0000000000000000 D _glapi_tls_Current
    libGLESv1_CM.so:                 U _glapi_tls_Current
    libGLESv2.so:                 U _glapi_tls_Current
    libGL.so:                 U _glapi_tls_Current
    libOpenGL.so:                 U _glapi_tls_Current


The version of are as follows :
    libGLdispatch.so -> libGLdispatch.so.0.0.0
    libGLESv1_CM.so -> libGLESv1_CM.so.1.0.0
    libGLESv2.so -> libGLESv2.so.2.0.0
    libGL.so -> libGL.so.1.0.0
    libOpenGL.so -> libOpenGL.so.0.0.0

I'm building with the flags -lGL and -lGLU and I'm using the nvidia proprietary drivers, linked to the kernel with akmod.

Thank you for helping solving this issue.

Comment 1 leigh scott 2017-04-07 11:34:43 UTC
Can you post

rpm -qa *\nvidia\*

Comment 2 N.Brack 2017-04-07 11:40:57 UTC
Yes.  Here is the output :

	xorg-x11-drv-nvidia-libs-375.51-3.fc23.x86_64
	kmod-nvidia-4.10.8-200.fc25.x86_64-375.51-2.fc25.x86_64
	xorg-x11-drv-nvidia-375.51-3.fc23.x86_64
	kmod-nvidia-4.10.6-200.fc25.x86_64-375.39-2.fc25.x86_64
	kmod-nvidia-4.9.14-200.fc25.x86_64-375.39-2.fc25.x86_64
	xorg-x11-drv-nvidia-kmodsrc-375.51-3.fc23.x86_64
	akmod-nvidia-375.51-2.fc23.x86_64

Comment 3 Nicolas Chauvet (kwizart) 2017-04-07 12:15:30 UTC
You are using the nvidia cuda repository, so your driver was updated to 375.51
That been said, you shouldn't need the nvidia driver at all to link to -lGL
You should use the mesa gl headers (or even the one from khronos directly).

That been said, it should work.
(note that you are missing the xorg-x11-drv-nvidia-devel that has the nvidia headers in /usr/include/nvidia and symlinks in /usr/lib64/nvidia, if really needed).

Comment 4 Nicolas Chauvet (kwizart) 2017-04-07 12:16:18 UTC
That been said, you should have any issue to link with -lGL with libglvnd...

Comment 5 N.Brack 2017-04-07 12:30:32 UTC
I have libglvnd-devel installed and I have no issues with the headers, the build error is purely when trying to link some .o files into an executable...

Comment 6 N.Brack 2017-04-10 07:42:02 UTC
This is really crippling me for my job.  How can I downgrade the driver or whatever to make everything work again ?

Comment 7 Hans de Goede 2017-04-10 07:50:21 UTC
(In reply to N.Brack from comment #6)
> This is really crippling me for my job.  How can I downgrade the driver or
> whatever to make everything work again ?

You need to add libglapi to the lists of libraries to which your lib / app links to fix this. Add -lglapi to the linker commandline should do the trick.

Comment 8 N.Brack 2017-04-10 08:44:30 UTC
It didn't work.  I now have the -lglapi flag added to the link command line, but I still have error

    /usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../lib64/libGL.so: undefined reference to `_glapi_tls_Current'

Comment 9 Hans de Goede 2017-04-10 09:08:36 UTC
Ah right, looks like you need -lGLdispatch but something is weird on your system, here on my system:

[hans@shalem ~]$ ldd -r /usr/lib64/libGL.so
        linux-vdso.so.1 (0x00007fffc977f000)
        libGLX.so.0 => /lib64/libGLX.so.0 (0x00007f93f1692000)
        libX11.so.6 => /lib64/libX11.so.6 (0x00007f93f1353000)
        libXext.so.6 => /lib64/libXext.so.6 (0x00007f93f1141000)
        libGLdispatch.so.0 => /lib64/libGLdispatch.so.0 (0x00007f93f0e8b000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f93f0c87000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f93f0a67000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f93f06a1000)
        libxcb.so.1 => /lib64/libxcb.so.1 (0x00007f93f0479000)
        /lib64/ld-linux-x86-64.so.2 (0x0000558bb0aaf000)
        libXau.so.6 => /lib64/libXau.so.6 (0x00007f93f0275000)

Note no unresolved symbols, so your libGL.so is different from mine ?

What is the output of:

[hans@shalem ~]$ rpm -qf /usr/lib64/libGL.so /usr/lib64/libGL.so.1
libglvnd-devel-0.2.999-10.gitdc16f8c.fc25.x86_64
libglvnd-glx-0.2.999-10.gitdc16f8c.fc25.x86_64
[hans@shalem ~]$ rpm --verify libglvnd-glx libglvnd-devel
[hans@shalem ~]$ 

On your system ?

Do you really need those ancient f23 nvidia pkgs ? Those are the likely cause of your problems.

Comment 10 N.Brack 2017-04-10 09:28:25 UTC
Actually my libGLdispatch.so is different !  I didn't notice I had two installed !

$ ldd -r libGL.so
	linux-vdso.so.1 (0x00007fff121c6000)
	libGLX.so.0 => /lib64/libGLX.so.0 (0x00007fb2065b5000)
	libX11.so.6 => /lib64/libX11.so.6 (0x00007fb206276000)
	libXext.so.6 => /lib64/libXext.so.6 (0x00007fb206064000)
	libGLdispatch.so.0 => /usr/lib64/nvidia/libGLdispatch.so.0 (0x00007fb205d7b000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fb205b77000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb205957000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fb205591000)
	libxcb.so.1 => /lib64/libxcb.so.1 (0x00007fb205369000)
	/lib64/ld-linux-x86-64.so.2 (0x000055dfc5048000)
	libXau.so.6 => /lib64/libXau.so.6 (0x00007fb205165000)

Using nm, that libGLdispatch in /usr/lib64/nvidia doesn't seem to have any _glapi_tls_Current symbol defined or referenced, so I guess it's the error.

I manually add -lGLdispatch, and it seems to build against /usr/lib64/libGLdispatch.so, so it works.

For sake of completeness here is the output of the last commands you issued :

    $ rpm -qf /usr/lib64/libGL.so /usr/lib64/libGL.so.1 
    libglvnd-devel-0.2.999-14.20170308git8e6e102.fc25.x86_64
    libglvnd-glx-0.2.999-14.20170308git8e6e102.fc25.x86_64
    $ rpm --verify libglvnd-glx
    $ rpm --verify libglvnd-devel

Comment 11 Hans de Goede 2017-04-10 10:56:53 UTC
(In reply to N.Brack from comment #10)
> Actually my libGLdispatch.so is different !  I didn't notice I had two
> installed !
> 
> $ ldd -r libGL.so
> 	linux-vdso.so.1 (0x00007fff121c6000)
> 	libGLX.so.0 => /lib64/libGLX.so.0 (0x00007fb2065b5000)
> 	libX11.so.6 => /lib64/libX11.so.6 (0x00007fb206276000)
> 	libXext.so.6 => /lib64/libXext.so.6 (0x00007fb206064000)
> 	libGLdispatch.so.0 => /usr/lib64/nvidia/libGLdispatch.so.0
> (0x00007fb205d7b000)

Yeah, so that is from an older libglvnd (the binary driver includes libglvnd) and you really should start using a newer pkg which does not include an old libglvnd copy, or alternatively remove the ld.so.conf.d
file the pkg is dropping, as that should not longer be necessary under F25.

Comment 12 N.Brack 2017-04-19 09:17:14 UTC
After several days waiting for an update, I can confirm : I do have all the latest packages.  The file /usr/lib64/nvidia/libGLdispatch.so.0 is owned by package xorg-x11-drv-nvidia-libs, which is at its latest version.  Uninstalling the package causes the file to disappear, reinstalling causes it to reappear.

What am I supposed to do with the ld.so.conf.d ?  It points to ld.so.conf.d, but the package do own files over there...

Comment 13 N.Brack 2017-04-19 09:18:57 UTC
> What am I supposed to do with the ld.so.conf.d ?  It points to ld.so.conf.d,
> but the package do own files over there...

I meant it contains a file nvidia-lib64.conf that points to /usr/lib64/nvidia.  Do I simply ignore nvidia's libraries and make it point to /usr/lib64 ?

Comment 14 Nicolas Chauvet (kwizart) 2017-04-19 09:21:50 UTC
(In reply to N.Brack from comment #12)
> After several days waiting for an update, I can confirm : I do have all the
> latest packages.  The file /usr/lib64/nvidia/libGLdispatch.so.0 is owned by
> package xorg-x11-drv-nvidia-libs, which is at its latest version. 
> Uninstalling the package causes the file to disappear, reinstalling causes
> it to reappear.

Which is the version of the package and where did you get it from ?
For f25, the current xorg-x11-drv-nvidia packages provided by RPM Fusion is not providing /usr/lib64/nvidia/libGLdispatch.so.0 anymore (it relies on libglvnd instead).S o you might have an outdated repository.

Comment 15 Nicolas Chauvet (kwizart) 2017-04-19 09:24:53 UTC
(In reply to N.Brack from comment #2)
> Yes.  Here is the output :
> 
> 	xorg-x11-drv-nvidia-libs-375.51-3.fc23.x86_64
This packages comes from the nvidia-cuda repository and have replaced the one from RPM Fusion.
You need to exclude the nvidia-cuda packages from the cuda.repo and downgrade to the RPM Fusion version

Comment 16 N.Brack 2017-04-19 09:40:25 UTC
Created attachment 1272545 [details]
Output of dnf list available 'xorg-x11-drv-nvidia*'

There's no xorg-x11-drv-nvidia-libs for 64bits in rpmfusion.  I attached what I get using `dnf list available`.

I can see only a 32-bit version of xorg-x11-drv-nvidia-libs and no packages xorg-x11-drv-nvidia at all...

Comment 17 leigh scott 2017-04-19 09:46:18 UTC
(In reply to N.Brack from comment #16)
> Created attachment 1272545 [details]
> Output of dnf list available 'xorg-x11-drv-nvidia*'
> 
> There's no xorg-x11-drv-nvidia-libs for 64bits in rpmfusion.  I attached
> what I get using `dnf list available`.
> 
> I can see only a 32-bit version of xorg-x11-drv-nvidia-libs and no packages
> xorg-x11-drv-nvidia at all...

Your command was limited, try

dnf  --showduplicates list available 'xorg-x11-drv-nvidia*'


instead

Comment 18 N.Brack 2017-04-19 10:00:53 UTC
Oh, yes I have the install xorg-x11-drv-nvidia in bright green and underlined and the one from rpmfusion in dark teal.

I uninstalled the xorg-x11-drv-nvidia from cuda and reinstalled it.  Dnf pulled it from rpmfusion and now it works :

	ldd libGL.so                     
		linux-vdso.so.1 (0x00007ffcbb7a5000)
		libGLX.so.0 => /lib64/libGLX.so.0 (0x00007fcf48415000)
		libX11.so.6 => /lib64/libX11.so.6 (0x00007fcf480d6000)
		libXext.so.6 => /lib64/libXext.so.6 (0x00007fcf47ec4000)
		libGLdispatch.so.0 => /lib64/libGLdispatch.so.0 (0x00007fcf47c0e000)
		libdl.so.2 => /lib64/libdl.so.2 (0x00007fcf47a0a000)
		libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fcf477ea000)
		libc.so.6 => /lib64/libc.so.6 (0x00007fcf47424000)
		libxcb.so.1 => /lib64/libxcb.so.1 (0x00007fcf471fc000)
		/lib64/ld-linux-x86-64.so.2 (0x0000563c0e313000)
		libXau.so.6 => /lib64/libXau.so.6 (0x00007fcf46ff8000)

I did not get everything of what's going on, but thank you so much for your support !  I do really appreciate it !


Note You need to log in before you can comment on or make changes to this bug.