Bug 35562 - Nouveau fails to link in Mesa 7.10.1
Summary: Nouveau fails to link in Mesa 7.10.1
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/nouveau (show other bugs)
Version: 7.10
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Nouveau Project
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-22 12:49 UTC by Bernhard Rosenkraenzer
Modified: 2011-07-12 03:37 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Proposed fix (4.72 KB, patch)
2011-04-11 02:25 UTC, Bernhard Rosenkraenzer
Details | Splinter Review

Description Bernhard Rosenkraenzer 2011-03-22 12:49:05 UTC
nouveau_vieux_dri.so.tmp: undefined reference to `BIND_RING'
nouveau_vieux_dri.so.tmp: undefined reference to `BEGIN_RING_NI'
nouveau_vieux_dri.so.tmp: undefined reference to `BEGIN_RING'

[ and after fixing those ]

nouveau_dri.so.tmp: undefined reference to `BEGIN_RING'
nouveau_dri.so.tmp: undefined reference to `BIND_RING'
nouveau_dri.so.tmp: undefined reference to `BEGIN_RING_NI'


These symbols are defined as static inline functions in nouveau/nv04_pushbuf.h in libdrm 2.4.24 - but that isn't included where the functions are being called.
Comment 1 nello martuscielli 2011-04-02 17:15:14 UTC
the same problem here on ppc32 (CRUX PPC 2.7).

libdrm-2.4.24 and linux-2.6.38.2 kernel.

my config:

./configure --prefix=/usr \
		--with-driver=dri \
		--with-dri-driverdir=/usr/lib/dri \
		--enable-glx-tls \
		--enable-gallium-radeon --enable-gallium-r600 \
		--enable-gallium-nouveau --enable-gallium-swrast
Comment 2 nello martuscielli 2011-04-02 17:16:26 UTC
the build error:

make[3]: Entering directory `/tmp/mesa3d/src/Mesa-7.10.1/src/gallium/targets/dri-nouveau'
gcc -c -I. -I../../../../src/mesa/drivers/dri/common -Iserver -I../../../../include -I../../../../include/GL/internal -I../../../../src/mapi -I../../../../src/gallium/include -I../../../../src/gallium/auxiliary -I../../../../src/gallium/drivers -I../../../../src/gallium/winsys -I../../../../src/mesa -I../../../../src/mesa/main -I../../../../src/mesa/math -I../../../../src/mesa/transform -I../../../../src/mesa/shader -I../../../../src/mesa/swrast -I../../../../src/mesa/swrast_setup -I../../../../src/egl/main -I../../../../src/egl/drivers/dri -I/usr/include/libdrm    -O3 -mcpu=7450 -mabi=altivec -fsigned-char -fomit-frame-pointer -ftree-loop-linear -ftree-loop-distribution -fpeel-loops -floop-interchange -floop-strip-mine -floop-block -fgraphite-identity -floop-parallelize-all -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden -fno-strict-aliasing  -fPIC  -DUSE_PPC_ASM -DUSE_VMX_ASM -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_XCB_DRI2 -DHAVE_LIBUDEV -DHAVE_XEXTPROTO_71 -DGALLIUM_RBUG -DGALLIUM_TRACE target.c -o target.o
/bin/sh ../../../../bin/mklib -o nouveau_dri.so.tmp -noprefix -linker 'g++' -ldflags ' -lstdc++' \
	target.o ../../../../src/mesa/drivers/dri/common/utils.o ../../../../src/mesa/drivers/dri/common/vblank.o ../../../../src/mesa/drivers/dri/common/dri_util.o ../../../../src/mesa/drivers/dri/common/xmlconfig.o   ../../../../src/gallium/state_trackers/dri/drm/libdridrm.a ../../../../src/gallium/winsys/nouveau/drm/libnouveaudrm.a ../../../../src/gallium/drivers/trace/libtrace.a ../../../../src/gallium/drivers/rbug/librbug.a ../../../../src/gallium/drivers/nvfx/libnvfx.a ../../../../src/gallium/drivers/nv50/libnv50.a ../../../../src/gallium/drivers/nouveau/libnouveau.a \
                -Wl,--start-group ../../../../src/mesa/libmesagallium.a ../../../../src/gallium/auxiliary/libgallium.a -Wl,--end-group \
                   -ldrm   -lexpat -lm -lpthread -ldl -ldrm_nouveau   
mklib: Making Linux shared library:  nouveau_dri.so.tmp
g++ -O3 -mcpu=7450 -mabi=altivec -fsigned-char -fomit-frame-pointer -ftree-loop-linear -ftree-loop-distribution -fpeel-loops -floop-interchange -floop-strip-mine -floop-block -fgraphite-identity -floop-parallelize-all -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden -fno-strict-aliasing  -fPIC  -DUSE_PPC_ASM -DUSE_VMX_ASM -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_XCB_DRI2 -DHAVE_LIBUDEV -DHAVE_XEXTPROTO_71 -o nouveau_dri.so.test ../../../../src/mesa/drivers/dri/common/dri_test.o nouveau_dri.so.tmp   -ldrm   -lexpat -lm -lpthread -ldl -ldrm_nouveau    -lstdc++;
nouveau_dri.so.tmp: undefined reference to `BIND_RING'
nouveau_dri.so.tmp: undefined reference to `BEGIN_RING_NI'
nouveau_dri.so.tmp: undefined reference to `BEGIN_RING'
collect2: ld returned 1 exit status
make[3]: *** [nouveau_dri.so] Error 1
make[3]: Leaving directory `/tmp/mesa3d/src/Mesa-7.10.1/src/gallium/targets/dri-nouveau'
make[2]: *** [default] Error 1
make[2]: Leaving directory `/tmp/mesa3d/src/Mesa-7.10.1/src/gallium/targets'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/tmp/mesa3d/src/Mesa-7.10.1/src'
make: *** [default] Error 1
Comment 3 Bernhard Rosenkraenzer 2011-04-11 02:25:29 UTC
Created attachment 45468 [details] [review]
Proposed fix

This fixes it for me.

No guarantees that the resulting driver will actually work (not sure which files need nv04_pushbuf.h and which files need nvc0_pushbuf.h...), all my test boxes have Intel or ATI graphics chips...
Comment 4 David Silva 2011-05-03 11:21:56 UTC
Thank you Bernhard for the patch. I tested it and it initially worked for the gallium nouveau driver, however it did not work when i tried to enable building the non-gallium nouveau driver. I found that it needed an additional reference to the header in nouveau_driver.h:
(the error references Mesa 7.10.1, but I'm compiling 7.10.2 and get the same error)

--- Mesa-7.10.1/src/mesa/drivers/dri/nouveau/nouveau_driver-orig.h	2011-01-26 01:52:45.000000000 +0200
+++ Mesa-7.10.1/src/mesa/drivers/dri/nouveau/nouveau_driver.h	2011-05-03 13:04:57.000000000 +0300
@@ -37,6 +37,7 @@
 #undef NDEBUG
 #include <assert.h>
 
+#include <nouveau/nv04_pushbuf.h>
 #include "nouveau_device.h"
 #include "nouveau_pushbuf.h"
 #include "nouveau_grobj.h"

I added these lines to your patch and now Mesa builds smoothly.
Kernel 2.6.38.4
libdrm 2.4.25
Mesa 7.10.2
(Slackware 13.37)

My config:

./configure \
  --prefix=/usr \
  --sysconfdir=/etc \
  --libdir=/usr/lib \
  --mandir=/usr/man \
  --docdir=/usr/doc/mesa-7.10.2 \
  --with-dri-driverdir=/usr/lib/xorg/modules/dri \
  --with-dri-drivers="i810,i915,i965,mach64,mga,nouveau,r128,r200,r300,r600,radeon,savage,sis,tdfx,unichrome,swrast" \
  --enable-xcb \
  --enable-gallium-nouveau \
  --build=i486-slackware-linux


I don't own any NVIDIA cards either, so a test from someone who does would be welcome.
Comment 5 Ridai Govinda Pombo 2011-05-30 10:18:33 UTC
David,

I tried mesa-7.10.2 and it fails with the same message. I have a NVidia card to test, does that patch work on mesa-7.10.2?

Thanks!

(In reply to comment #4)
> Thank you Bernhard for the patch. I tested it and it initially worked for the
> gallium nouveau driver, however it did not work when i tried to enable building
> the non-gallium nouveau driver. I found that it needed an additional reference
> to the header in nouveau_driver.h:
> (the error references Mesa 7.10.1, but I'm compiling 7.10.2 and get the same
> error)
> 
> --- Mesa-7.10.1/src/mesa/drivers/dri/nouveau/nouveau_driver-orig.h   
> 2011-01-26 01:52:45.000000000 +0200
> +++ Mesa-7.10.1/src/mesa/drivers/dri/nouveau/nouveau_driver.h    2011-05-03
> 13:04:57.000000000 +0300
> @@ -37,6 +37,7 @@
>  #undef NDEBUG
>  #include <assert.h>
> 
> +#include <nouveau/nv04_pushbuf.h>
>  #include "nouveau_device.h"
>  #include "nouveau_pushbuf.h"
>  #include "nouveau_grobj.h"
> 
> I added these lines to your patch and now Mesa builds smoothly.
> Kernel 2.6.38.4
> libdrm 2.4.25
> Mesa 7.10.2
> (Slackware 13.37)
> 
> My config:
> 
> ./configure \
>   --prefix=/usr \
>   --sysconfdir=/etc \
>   --libdir=/usr/lib \
>   --mandir=/usr/man \
>   --docdir=/usr/doc/mesa-7.10.2 \
>   --with-dri-driverdir=/usr/lib/xorg/modules/dri \
>  
> --with-dri-drivers="i810,i915,i965,mach64,mga,nouveau,r128,r200,r300,r600,radeon,savage,sis,tdfx,unichrome,swrast"
> \
>   --enable-xcb \
>   --enable-gallium-nouveau \
>   --build=i486-slackware-linux
> 
> 
> I don't own any NVIDIA cards either, so a test from someone who does would be
> welcome.
Comment 6 "One" Timothy Jones 2011-07-10 07:44:30 UTC
Ridai, FWIW, this patch works with Mesa 7.10.3. So, I'd think it work with .2 as well.

-TJ
Comment 7 Emil Velikov 2011-07-11 08:22:01 UTC
Patch has been pushed into the 7.10 branch
commit bd40e7ce (nouveau: fix includes for latest libdrm)

Can you please confirm that it resolves the issue

Cheers
Emil
Comment 8 Robby Workman 2011-07-11 22:57:26 UTC
Yep, that patch fixes compilation; thanks!
Comment 9 Emil Velikov 2011-07-12 03:37:58 UTC
Reported FIXED


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.