Bug 50001

Summary: mesa from git fails to compile with <gcc-4.6
Product: Mesa Reporter: Michael Lange <linuxstuff>
Component: OtherAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Possible fix
pipe_loader_anon_union.patch

Description Michael Lange 2012-05-16 05:42:30 UTC
gallium/auxiliary/pipe-loader

mesa fails to compile with gcc-4.5.3

In file included from pipe_loader_priv.h:31:0,
                 from pipe_loader_drm.c:39:
pipe_loader.h:61:5: warning: declaration does not declare anything
pipe_loader_drm.c: In function 'find_drm_pci_id':
pipe_loader_drm.c:81:43: error: 'struct pipe_loader_device' has no member named 'pci'
pipe_loader_drm.c:82:26: error: 'struct pipe_loader_device' has no member named 'pci'
pipe_loader_drm.c: In function 'find_drm_driver_name':
pipe_loader_drm.c:104:14: error: 'struct pipe_loader_device' has no member named 'pci'
pipe_loader_drm.c:113:17: error: 'struct pipe_loader_device' has no member named 'pci'
pipe_loader_drm.c:123:50: error: 'struct pipe_loader_device' has no member named 'pci'
pipe_loader_drm.c:124:20: error: 'struct pipe_loader_device' has no member named 'pci'
gmake[4]: *** [pipe_loader_drm.lo] Error 1

with gcc-4.6.3 all is fine
Comment 1 Brian Paul 2012-05-16 06:27:55 UTC
Same here, but configure says so if I try --enable-opencl:

configure: error: gcc >= 4.6 is required to build clover

I'll see if Tom Stellard can comment on this...
Comment 2 Tom Stellard 2012-05-16 06:45:24 UTC
Created attachment 61714 [details] [review]
Possible fix

I think this anonymous union is the problem.  I'm not really sure why that's there, but I'm guess it's part of the latest C standard.  Does this patch help?
Comment 3 Francisco Jerez 2012-05-16 07:04:38 UTC
Created attachment 61715 [details] [review]
pipe_loader_anon_union.patch

I'm attaching an alternative fix that doesn't get rid of the union, it's likely to be useful someday.
Comment 4 Michael Lange 2012-05-16 09:20:50 UTC
mesa compiles fine with gcc-4.5.3 and the patch vom Francisco Jerez  (pipe_loader_anon_union.patch)

thx
Comment 5 Francisco Jerez 2012-05-16 09:59:47 UTC
(In reply to comment #4)
> mesa compiles fine with gcc-4.5.3 and the patch vom Francisco Jerez 
> (pipe_loader_anon_union.patch)
> 
> thx

OK, thanks, this should be fixed in master now.

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.