https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67599
Bug ID: 67599
Summary: linux build fails for openrisc compiler
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: blocker
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: sudipm.mukherjee at gmail dot com
Target Milestone: ---
I tried to compile on x86_64 the linux mainline kernel with openrisc gcc
compiler version 4.5.1-or32-1.0rc1 with allmodconfig option and the build
failed with the error:
drivers/vhost/vhost.c: In function 'vhost_vring_ioctl':
drivers/vhost/vhost.c:818:3: error: call to '__compiletime_assert_818' declared
with attribute error: BUILD_BUG_ON failed: __alignof__ *vq->avail >
VRING_AVAIL_ALIGN_SIZE
Had a discussion on lkml and :
"VRING_AVAIL_ALIGN_SIZE is 2
*vq->avail is:
struct vring_avail {
__virtio16 flags;
__virtio16 idx;
__virtio16 ring[];
};
And __virtio16 is just a u16 with some sparse annotations.
Looking at openrisc architecture document:
Operand: Length addr[3:0] if aligned
Halfword (or half) 2 bytes Xxx0
Type C-TYPE Sizeof Alignment Openrisc Equivalent
Short Signed short 2 2 Signed halfword
and
16.1.2
Aggregates and Unions
Aggregates (structures and arrays) and unions assume the alignment of their
most
strictly aligned element.
"
So we suspect that there may be something wrong with the compiler.
You can see the build log at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/80365425
regards
sudip