Neil Hopcroft

A digital misfit

Fixing the mesa build

At long last I’ve gotten around to fixing the mesa build – there were a couple of problems:

nouveau_screen.c: In function ‘nouveau_init_screen2’:
nouveau_screen.c:105:2: error: implicit declaration of function ‘nouveau_drm_new’ [-Werror=implicit-function-declaration]
ret = nouveau_drm_new(dri_screen->fd, &screen->drm);
^
nouveau_screen.c:111:2: error: implicit declaration of function ‘nouveau_device_new’ [-Werror=implicit-function-declaration]
ret = nouveau_device_new(&screen->drm->client, NV_DEVICE,
^
nouveau_screen.c:111:39: error: dereferencing pointer to incomplete type
ret = nouveau_device_new(&screen->drm->client, NV_DEVICE,
^
nouveau_screen.c: In function ‘nouveau_destroy_screen’:
nouveau_screen.c:229:2: error: implicit declaration of function ‘nouveau_drm_del’ [-Werror=implicit-function-declaration]
nouveau_drm_del(&screen->drm);
^

I spent a little while tracking this down, it turns out that I had three sets of pkgconfig .pc files for drm nouveau, one in /usr/lib/pkgconfig, one in /usr/lib64/pkgconfig and one in /usr/local/lib64/pkgconfig – the version being built by Jenkins being the one in /usr/local/lib64 while the others represented versions installed by the package manager. Removing those from /usr/lib and /usr/lib64 got the build looking at the latest version. However the error remained unchanged.

Looking at the build log, I notice this from the configure output:

DRI platform: drm
DRI drivers: i915 i965 nouveau r200 radeon swrast
DRI driver dir: ${libdir}/dri
GLX: DRI-based

The error occurs during the compilation of the nouveau DRI driver, so setting “–with-dri-drivers=i915,i965,r200,radeon,swrast” on the configure command line removes the driver from the build.
This leaves me with

../../src/loader/.libs/libloader_dri3_helper.a(loader_dri3_helper.o): In function `dri3_wait_for_event’:
/usr/share/tomcat7/.jenkins/workspace/mesa/src/loader/loader_dri3_helper.c:280: undefined reference to `xcb_wait_for_special_event’
../../src/loader/.libs/libloader_dri3_helper.a(loader_dri3_helper.o): In function `dri3_find_back’:
/usr/share/tomcat7/.jenkins/workspace/mesa/src/loader/loader_dri3_helper.c:380: undefined reference to `xcb_wait_for_special_event’
../../src/loader/.libs/libloader_dri3_helper.a(loader_dri3_helper.o): In function `dri3_flush_present_events’:
/usr/share/tomcat7/.jenkins/workspace/mesa/src/loader/loader_dri3_helper.c:613: undefined reference to `xcb_poll_for_special_event’
../../src/loader/.libs/libloader_dri3_helper.a(loader_dri3_helper.o): In function `dri3_update_drawable’:
/usr/share/tomcat7/.jenkins/workspace/mesa/src/loader/loader_dri3_helper.c:986: undefined reference to `xcb_register_for_special_xge’
/usr/share/tomcat7/.jenkins/workspace/mesa/src/loader/loader_dri3_helper.c:1030: undefined reference to `xcb_unregister_for_special_event’
../../src/loader/.libs/libloader_dri3_helper.a(loader_dri3_helper.o): In function `loader_dri3_drawable_fini’:
/usr/share/tomcat7/.jenkins/workspace/mesa/src/loader/loader_dri3_helper.c:122: undefined reference to `xcb_unregister_for_special_event’
collect2: error: ld returned 1 exit status

Again there are multiple pkgconfig .pc files for xcb in /usr/lib/pkgconfig, /usr/lib64/pkgconfig and /usr/local/lib64/pkgconfig. Removing those installed by the package manager and leaving those from the libxcb build resolves this problem.
Fixed in build #438.


Leave a Reply

Your email address will not be published.