Bug 100225 - Mesa fails to build after commit c5a0829e1f56f6bb728ee2d200918ffa0f8842a6
Summary: Mesa fails to build after commit c5a0829e1f56f6bb728ee2d200918ffa0f8842a6
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/intel (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-16 06:40 UTC by network723
Modified: 2017-03-17 19:54 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch to try (994 bytes, patch)
2017-03-16 15:56 UTC, Jason Ekstrand
Details | Splinter Review
Alternate (possibly better) patch (1.14 KB, patch)
2017-03-17 16:18 UTC, Jason Ekstrand
Details | Splinter Review

Description network723 2017-03-16 06:40:26 UTC
Mesa fails to build after recent ANV changes:

[  165s] vulkan/anv_device.c:697:4: error: (near initialization for 'anv_queue_family_properties.minImageTransferGranularity')
[  165s]   CC       vulkan/vulkan_libvulkan_common_la-anv_dump.lo
[  165s] Makefile:3134: recipe for target 'vulkan/vulkan_libvulkan_common_la-anv_device.lo' failed
[  165s] make[4]: *** [vulkan/vulkan_libvulkan_common_la-anv_device.lo] Error 1
[  165s] make[4]: *** Waiting for unfinished jobs....
[  165s] make[4]: Leaving directory '/home/abuild/rpmbuild/BUILD/mesa/src/intel'
[  165s] Makefile:1905: recipe for target 'all' failed
[  165s] make[3]: *** [all] Error 2
[  165s] make[3]: Leaving directory '/home/abuild/rpmbuild/BUILD/mesa/src/intel'
[  165s] Makefile:841: recipe for target 'all-recursive' failed
[  165s] make[2]: *** [all-recursive] Error 1
[  165s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/mesa/src'
[  165s] Makefile:631: recipe for target 'all' failed
[  165s] make[1]: *** [all] Error 2
[  165s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/mesa/src'
[  165s] Makefile:633: recipe for target 'all-recursive' failed
[  165s] make: *** [all-recursive] Error 1
[  165s] error: Bad exit status from /var/tmp/rpm-tmp.ZzMi39 (%build)

I didn't bisect, but the change to anv_queue_family_properties was introduced by commit c5a0829e1f56f6bb728ee2d200918ffa0f8842a6
Comment 1 network723 2017-03-16 06:42:47 UTC
Sorry, didn't copy first 4 lines:

[  165s] vulkan/anv_device.c: At top level:
[  165s] vulkan/anv_device.c:697:4: error: initializer element is not constant
[  165s]     .minImageTransferGranularity = (VkExtent3D) { 1, 1, 1 },
[  165s]     ^
Comment 2 Jason Ekstrand 2017-03-16 15:56:07 UTC
Created attachment 130264 [details] [review]
Patch to try

I've attached a patch for you to try.  Also, what version of GCC are you using?  It builds fine with modern versions.
Comment 3 network723 2017-03-16 18:56:16 UTC
Ok, I'll try to apply the patch and tell if that helps.

I believe that the default gcc version for openSUSE 42.2 is 4.8. But gcc5 and gcc6 are also available as an alternative.
Comment 4 network723 2017-03-16 19:25:30 UTC
(In reply to Jason Ekstrand from comment #2)
> Created attachment 130264 [details] [review] [review]
> Patch to try

Build finished successfully with you patch.
Comment 5 Jason Ekstrand 2017-03-17 16:18:09 UTC
Created attachment 130293 [details] [review]
Alternate (possibly better) patch

I just attached a slightly different patch for you to try.  If this patch works, then I think it's a better solution because the type is still nicely declared.
Comment 6 network723 2017-03-17 18:25:10 UTC
New patch does not work, same error:

[  146s] vulkan/anv_device.c: At top level:
[  146s] vulkan/anv_device.c:697:4: error: initializer element is not constant
[  146s]     .minImageTransferGranularity = (const VkExtent3D) { 1, 1, 1 },
[  146s]     ^
[  146s] vulkan/anv_device.c:697:4: error: (near initialization for 'anv_queue_family_properties.minImageTransferGranularity')
[  146s]   CC       vulkan/vulkan_libvulkan_common_la-anv_dump.lo
[  146s] Makefile:3134: recipe for target 'vulkan/vulkan_libvulkan_common_la-anv_device.lo' failed
Comment 7 Jason Ekstrand 2017-03-17 19:51:38 UTC
(In reply to network723 from comment #6)
> New patch does not work, same error:
> 
> [  146s] vulkan/anv_device.c: At top level:
> [  146s] vulkan/anv_device.c:697:4: error: initializer element is not
> constant
> [  146s]     .minImageTransferGranularity = (const VkExtent3D) { 1, 1, 1 },
> [  146s]     ^
> [  146s] vulkan/anv_device.c:697:4: error: (near initialization for
> 'anv_queue_family_properties.minImageTransferGranularity')
> [  146s]   CC       vulkan/vulkan_libvulkan_common_la-anv_dump.lo
> [  146s] Makefile:3134: recipe for target
> 'vulkan/vulkan_libvulkan_common_la-anv_device.lo' failed

Bummer.  We'll go with the first patch then.
Comment 8 Jason Ekstrand 2017-03-17 19:54:58 UTC
Fixed by the following commit:

commit 28b134c75c1fa3b2aaa00dc168f0eca35ccd346d
Author: Jason Ekstrand <jason.ekstrand@intel.com>
Date:   Thu Mar 16 08:50:36 2017 -0700

    anv/device: Remove a use of a compound literal
    
    Older versions of GCC don't like compound literals in static const
    variable declarations because they don't think it's an actual constant
    value.
    
    Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>


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.