Bug 101199

Summary: nouveau_screen.c: undefined reference to `nouveau_drm_del'
Product: Mesa Reporter: Andrey <andrewponomarenko>
Component: OtherAssignee: mesa-dev
Status: RESOLVED WORKSFORME QA Contact: mesa-dev
Severity: normal    
Priority: medium    
Version: 17.1   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Andrey 2017-05-26 12:38:28 UTC
The build of mesa 17.1.1 has failed with error:

nouveau_screen.c:230: undefined reference to `nouveau_drm_del'
nouveau/.libs/libnouveau_dri.a(nouveau_screen.o): In function `nouveau_init_screen2':
nouveau/nouveau_screen.c:105: undefined reference to `nouveau_drm_new'
nouveau/nouveau_screen.c:111: undefined reference to `nouveau_device_new'

The library is configured with the following parameters:

./configure --enable-shared --enable-glx --disable-osmesa --enable-debug --enable-gles2 --enable-gles1 --with-llvm-prefix=/path/to/LLVM-3.8.1/ PKG_CONFIG_PATH='/path/to/libdrm/2.4.80/lib/pkgconfig'

GCC version: 4.9.2
Comment 1 Ilia Mirkin 2017-05-26 13:04:38 UTC
You have an issue on your system. You're picking up a version of drm/nouveau.h which is not the one that configure found.
Comment 2 Andrey 2017-05-27 03:11:58 UTC
(In reply to Ilia Mirkin from comment #1)
> You have an issue on your system. You're picking up a version of
> drm/nouveau.h which is not the one that configure found.

I have two libdrms:

1) The system's one libdrm-devel-2.4.60-1.fc21.x86_64
2) The local one needed for mesa: /path/to/libdrm/2.4.80/

How can I tell configure to pick up a right one?

Thank you.
Comment 3 Ilia Mirkin 2017-05-27 14:08:51 UTC
(In reply to Andrey from comment #2)
> (In reply to Ilia Mirkin from comment #1)
> > You have an issue on your system. You're picking up a version of
> > drm/nouveau.h which is not the one that configure found.
> 
> I have two libdrms:
> 
> 1) The system's one libdrm-devel-2.4.60-1.fc21.x86_64
> 2) The local one needed for mesa: /path/to/libdrm/2.4.80/
> 
> How can I tell configure to pick up a right one?
> 
> Thank you.

No clue. If libdrm-devel is installed in a system path, and you have other libraries installed in system paths, this may not be a supportable configuration, since all include paths are just mashed together.

Uninstall libdrm-devel perhaps?

Either way, not a nouveau issue.
Comment 4 Andrey 2017-05-28 03:41:38 UTC
This is an issue with the Mesa build system. The configure script should choose right libdrm from PKG_CONFIG_PATH specified.
Comment 5 Ilia Mirkin 2017-05-28 15:00:37 UTC
(In reply to Andrey from comment #4)
> This is an issue with the Mesa build system. The configure script should
> choose right libdrm from PKG_CONFIG_PATH specified.

The configure script does pick the right libdrm. (Otherwise it wouldn't let you build with 2.4.60.)

You're probably going to have to do the debugging yourself to figure out why or how the wrong file is being picked up.
Comment 6 Emil Velikov 2017-05-29 16:51:32 UTC
I'd imagine that the system libdrm_nouveau is v2.6.65 or earlier and the issue happens only during make install. Is that correct?

If so, it may be a libtool bug^feature and this workaround should work:
$ export LD_LIBRARY_PATH=/path/to/libdrm/2.4.80/lib/:$LD_LIBRARY_PATH
$ ./configure ...
Comment 7 Andrey 2017-06-07 07:24:05 UTC
(In reply to Emil Velikov from comment #6)
> I'd imagine that the system libdrm_nouveau is v2.6.65 or earlier and the
> issue happens only during make install. Is that correct?
> 
> If so, it may be a libtool bug^feature and this workaround should work:
> $ export LD_LIBRARY_PATH=/path/to/libdrm/2.4.80/lib/:$LD_LIBRARY_PATH
> $ ./configure ...

This has fixed the problem.

However, for other libraries with external dependencies specifying of PKG_CONFIG_PATH parameter for configure is enough to configure, make and make install. So this is only a workaround.

Thank you.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.