Bug 713609 - problem compiling some drivers on ARM
Summary: problem compiling some drivers on ARM
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: mesa
Version: 14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Adam Jackson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ARMTracker
TreeView+ depends on / blocked
 
Reported: 2011-06-15 22:50 UTC by Peter Robinson
Modified: 2011-09-16 12:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-16 12:16:19 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
configure.ac patch (639 bytes, patch)
2011-09-02 18:14 UTC, Daniel Drake
no flags Details | Diff
configure.ac patch (832 bytes, patch)
2011-09-03 19:17 UTC, Daniel Drake
no flags Details | Diff
F14: fix sis driver compile issue (2.27 KB, patch)
2011-09-15 18:58 UTC, Daniel Drake
no flags Details | Diff
F15: fix sis driver compile issue (2.24 KB, patch)
2011-09-15 19:01 UTC, Daniel Drake
no flags Details | Diff

Description Peter Robinson 2011-06-15 22:50:32 UTC
I'm trying to compile mesa on ARM. Its erroring on the SIS driver. 

Full log is here, relevant bit below.
http://arm.koji.fedoraproject.org/koji/watchlogs?taskID=97857

I found a similar fix used here for PPC
http://web.archiveorange.com/archive/v/fXkbRBZcoackJK1pbAKI

I'm not sure if that's the correct fix or whether we would be better just adding an if/else statement excluding any embedded x86 only GPUs from compiling on the arm (and likely other non x86 platforms that might be interested).

gmake[5]: Entering directory `/builddir/build/BUILD/mesa-20101014/src/mesa/drivers/dri/sis'
gmake[6]: Entering directory `/builddir/build/BUILD/mesa-20101014/src/mesa/drivers/dri/sis'
gcc -c -I. -I../../../../../src/mesa/drivers/dri/common -Iserver -I../../../../../include -I../../../../../src/mapi -I../../../../../src/mesa -I../../../../../src/egl/main -I../../../../../src/egl/drivers/dri -I/usr/include/libdrm    -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=armv5te -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden -fno-strict-aliasing  -fPIC   -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DMESA_SELINUX -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DFEATURE_GL=1  sis6326_state.c -o sis6326_state.o
gcc -c -I. -I../../../../../src/mesa/drivers/dri/common -Iserver -I../../../../../include -I../../../../../src/mapi -I../../../../../src/mesa -I../../../../../src/egl/main -I../../../../../src/egl/drivers/dri -I/usr/include/libdrm    -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=armv5te -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden -fno-strict-aliasing  -fPIC   -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DMESA_SELINUX -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DFEATURE_GL=1  sis6326_clear.c -o sis6326_clear.o
In file included from sis6326_state.c:29:0:
sis_context.h:408:2: error: #error platform needs WMB
gmake[6]: *** [sis6326_state.o] Error 1
gmake[6]: *** Waiting for unfinished jobs....
In file included from sis6326_clear.c:29:0:
sis_context.h:408:2: error: #error platform needs WMB
sis6326_clear.c: In function 'sis_clear_back_buffer':
sis6326_clear.c:158:4: warning: implicit declaration of function 'MMIO_WMB'
gmake[6]: Leaving directory `/builddir/build/BUILD/mesa-20101014/src/mesa/drivers/dri/sis'
gmake[6]: *** [sis6326_clear.o] Error 1
gmake[5]: *** [lib] Error 2
gmake[5]: Leaving directory `/builddir/build/BUILD/mesa-20101014/src/mesa/drivers/dri/sis'
gmake[4]: Leaving directory `/builddir/build/BUILD/mesa-20101014/src/mesa/drivers/dri'
gmake[4]: *** [subdirs] Error 1
gmake[3]: *** [default] Error 1
gmake[3]: Leaving directory `/builddir/build/BUILD/mesa-20101014/src/mesa/drivers'
gmake[2]: Leaving directory `/builddir/build/BUILD/mesa-20101014/src/mesa'
gmake[2]: *** [driver_subdirs] Error 2
make[1]: *** [subdirs] Error 1
make: *** [default] Error 1

Comment 1 Peter Robinson 2011-06-18 22:04:15 UTC
Disabling SIS we get the following error on r300

g++ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=armv5te -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden -fno-strict-aliasing  -fPIC   -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DMESA_SELINUX -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -o r300_dri.so.test ../../../../src/mesa/drivers/dri/common/dri_test.o r300_dri.so.tmp  -lselinux -ldrm   -lexpat -lm -lpthread -ldl -ltalloc   -ldrm_radeon  -lstdc++;
/usr/bin/ld: r300_dri.so.test: hidden symbol `__sync_sub_and_fetch_4' in /usr/lib/gcc/armv5tel-redhat-linux-gnueabi/4.5.1/libgcc.a(linux-atomic.o) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
gmake[3]: Leaving directory `/builddir/build/BUILD/mesa-20101220/src/gallium/targets/dri-r300'
gmake[3]: *** [r300_dri.so] Error 1
gmake[2]: Leaving directory `/builddir/build/BUILD/mesa-20101220/src/gallium/targets'
gmake[2]: *** [default] Error 1
make[1]: Leaving directory `/builddir/build/BUILD/mesa-20101220/src'
make[1]: *** [subdirs] Error 1
make: *** [default] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.gGEhWE (%build)
    Bad exit status from /var/tmp/rpm-tmp.gGEhWE (%build)
RPM build errors:
Child returncode was: 1

Comment 2 Adam Jackson 2011-06-20 17:03:18 UTC
SiS isn't an onboard-only chip, there exist PCI variants.  They're all awful, of course, but that's not an excuse.

The r300 error looks like it's missing a '-shared'.

Comment 3 Peter Robinson 2011-06-20 20:35:10 UTC
(In reply to comment #2)
> SiS isn't an onboard-only chip, there exist PCI variants.  They're all awful,
> of course, but that's not an excuse.

Oh, for some reason I thought they were only in cheapo Northbridges. 

> The r300 error looks like it's missing a '-shared'.

Looks like the nouveau driver is missing the '-shared' as well. Not sure if the Makefile error has any impact on that. Is a fix just a matter of adding it to the common_flags or cflags?

gmake[3]: Entering directory `/builddir/build/BUILD/mesa-20101220/src/gallium/targets/dri-nouveau'
../Makefile.dri:116: depend: No such file or directory
rm -f depend
touch depend
/usr/bin/makedepend -fdepend -I/usr/lib/gcc/armv5tel-redhat-linux-gnueabi/4.5.1/include -DGALLIUM_RBUG -DGALLIUM_TRACE -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    target.c ../../../../src/mesa/drivers/dri/common/utils.c ../../../../src/mesa/drivers/dri/common/vblank.c ../../../../src/mesa/drivers/dri/common/dri_util.c ../../../../src/mesa/drivers/dri/common/xmlconfig.c  \
	 2> /dev/null
gmake[3]: Leaving directory `/builddir/build/BUILD/mesa-20101220/src/gallium/targets/dri-nouveau'
gmake[3]: Entering directory `/builddir/build/BUILD/mesa-20101220/src/gallium/targets/dri-nouveau'
mkdir -p ../../../../lib/gallium
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    -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=armv5te -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden -fno-strict-aliasing  -fPIC   -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DMESA_SELINUX -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -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 \
                  -lselinux -ldrm   -lexpat -lm -lpthread -ldl -ltalloc   -ldrm_nouveau   
mklib: Making Linux shared library:  nouveau_dri.so.tmp
g++ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=armv5te -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden -fno-strict-aliasing  -fPIC   -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DMESA_SELINUX -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -o nouveau_dri.so.test ../../../../src/mesa/drivers/dri/common/dri_test.o nouveau_dri.so.tmp  -lselinux -ldrm   -lexpat -lm -lpthread -ldl -ltalloc   -ldrm_nouveau    -lstdc++;
/usr/bin/ld: nouveau_dri.so.test: hidden symbol `__sync_sub_and_fetch_4' in /usr/lib/gcc/armv5tel-redhat-linux-gnueabi/4.5.1/libgcc.a(linux-atomic.o) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status

Comment 4 Daniel Drake 2011-09-02 18:14:29 UTC
Created attachment 521272 [details]
configure.ac patch

The above '-shared' problems were solved by bug #733549.

Removing the sis driver from the build lets it run to near completion. The attached patch could be used. Upstream has already removed this driver.

However the build now fails at the very end when packaging up stuff listed under %files because it can't find 
BUILDROOT/mesa-7.9-5.fc14.arm/usr/lib/dri/nouveau_vieux_dri.so

Need to determine why that isn't being built on ARM and what can be done about it.

Comment 5 Daniel Drake 2011-09-03 19:17:09 UTC
Created attachment 521341 [details]
configure.ac patch

Oops, there was an error in my patch where I was not building nouveau. Here's an updated patch which fixes that.

I confirm this patch works on mesa on F14 with no spec changes (other than the application of the patch).

The patch also applies cleanly to the F15 mesa version and should be applied there too.

For F16/master I see there is some new logic in the spec file to only build certain drivers on certain platforms, and it looks like the default is not to build sis, so I think in master we're all set (but we aren't yet building F16 for ARM).

If this patch looks OK I'm happy to commit it to the mesa package for F14 and F15, if that helps at all!

Comment 6 Daniel Drake 2011-09-15 18:58:33 UTC
Created attachment 523427 [details]
F14: fix sis driver compile issue

Here is a better fix, for the f14 branch. It is a trivial backport of a commit from F16 which fixes this particular compile issue. Tested and working.

Comment 7 Daniel Drake 2011-09-15 19:01:48 UTC
Created attachment 523429 [details]
F15: fix sis driver compile issue

Here is the same thing for F15.  Or maybe merging the f16 branch into the f15 branch would be preferred (as seems to have happened recently).

Note that even before changing anything, the current f15 version fails to build in koji. Odd.
http://koji.fedoraproject.org/koji/taskinfo?taskID=3353243

Anyway, I have tested this in that the patch applies to the F15 version, even if compile fails later for unrelated reasons.

Comment 8 Adam Jackson 2011-09-15 19:35:36 UTC
Merging F16 to F15 is fine, just don't try merging all the way to F14, libdrm is too old for that to work I think.

Weird that it fails to find libffi, it's certainly in the buildroot.

Comment 9 Daniel Drake 2011-09-15 19:48:56 UTC
Thanks for looking - I'm just finishing off for today but will commit this tomorrow then (f14 patch, f16 merge to f15).

Comment 10 Daniel Drake 2011-09-16 12:16:19 UTC
Done, and built successfully on ARM for F14. Thanks for your help!


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