Bug 1171123 - GCC 10: qemu build fails on i586
GCC 10: qemu build fails on i586
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: E-mail List
E-mail List
:
Depends on:
Blocks: 1157217
  Show dependency treegraph
 
Reported: 2020-05-04 18:22 UTC by Martin Liška
Modified: 2020-06-28 17:23 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2020-05-04 18:22:29 UTC
Fails here:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:N/qemu/standard/i586

with:
[  861s] drivers/net/intelvf.c: In function 'intelvf_mbox_poll':
[  861s] drivers/net/intelvf.c:80:13: error: array subscript i is outside array bounds of 'uint32_t[0]' {aka 'unsigned int[]'} [-Werror=array-bounds]
[  861s]    80 |   msg->dword[i] = readl ( intel->regs + intel->mbox.mem +
[  861s]       |   ~~~~~~~~~~^~~
[  861s] In file included from drivers/net/intelvf.c:32:
[  861s] drivers/net/intelvf.h:135:11: note: while referencing 'dword'
[  861s]   135 |  uint32_t dword[0];
[  861s]       |           ^~~~~
[  861s] drivers/net/intelvf.c:98:20: note: defined here 'msg'
[  861s]    98 |  union intelvf_msg msg;
[  861s]       |                    ^~~

It's analyzed in GCC bugzilla:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94940#c4
Comment 1 Bruce Rogers 2020-05-04 21:16:17 UTC
Just to be clear, this code is a git-submodule which represents a separate project, the ipxe project (https://ipxe.org/) and should be raised with them.

Not too many consumers of qemu code worry about rebuilding the in project firmware like we do, but in the past the ipxe maintainer is happy to accept code fixes to ensure compatbility with the latest tools.

Do you have a suggested fix? I'll see what I can come up with as well.
Comment 2 Martin Liška 2020-05-05 04:56:57 UTC
The issue can be fixed with something like:

cat gcc10-werror-fix.patch
diff --git a/roms/ipxe/src/drivers/net/intelvf.h b/roms/ipxe/src/drivers/net/intelvf.h
index ab404698..abc2cd25 100644
--- a/roms/ipxe/src/drivers/net/intelvf.h
+++ b/roms/ipxe/src/drivers/net/intelvf.h
@@ -132,7 +132,7 @@ union intelvf_msg {
 	/** Queue configuration message */
 	struct intelvf_msg_queues queues;
 	/** Raw dwords */
-	uint32_t dword[0];
+	uint32_t dword[1];
 };
 
 /** Maximum time to wait for mailbox message

But I see another one:
[  299s] drivers/infiniband/flexboot_nodnic.c: In function 'flexboot_nodnic_create_qp':
[  299s] drivers/infiniband/flexboot_nodnic.c:368:53: error: implicit conversion from 'enum ib_queue_pair_type' to 'nodnic_queue_pair_type' [-Werror=enum-conversion]
[  299s]   368 |  status = nodnic_port_create_qp(&port->port_priv, qp->type,
[  299s]       |                                                   ~~^~~~~~
[  299s] drivers/infiniband/flexboot_nodnic.c: In function 'flexboot_nodnic_destroy_qp':
[  299s] drivers/infiniband/flexboot_nodnic.c:409:45: error: implicit conversion from 'enum ib_queue_pair_type' to 'nodnic_queue_pair_type' [-Werror=enum-conversion]
[  299s]   409 |  nodnic_port_destroy_qp(&port->port_priv, qp->type,
[  299s]       |                                           ~~^~~~~~

@Bruce: Can we please disable -Werror as out openSUSE guideline sais:
https://en.opensuse.org/openSUSE:Specfile_guidelines#Werror
Comment 3 Swamp Workflow Management 2020-05-06 23:40:09 UTC
This is an autogenerated message for OBS integration:
This bug (1171123) was mentioned in
https://build.opensuse.org/request/show/800842 Factory / qemu
Comment 4 Martin Liška 2020-05-13 07:46:22 UTC
Should be fixed now.
Comment 5 Bruce Rogers 2020-06-28 17:23:49 UTC
This got fixed upstream with commit 8a1d66c7aec020f3e90254ed2fa55ecd9494fcc3.
I've replaced the temporary fix in the package with the upstream version.