[libvirt] [resend] fix libvirt alignment on arm platforms
Eric Blake
eblake at redhat.com
Thu Dec 12 17:58:26 UTC 2013
On 12/12/2013 10:05 AM, Michele Paolino wrote:
> With the changes added by the latest commits (e.g.
> 8a29ffcf9aee45b61a0a12ee45c656cfd52333e8) related to "new events feature
> v2",
> we are unable to compile libvirt on ARM target (OMAP5).
> The error is due to alignment:
> conf/domain_event.c: In function 'virDomainEventDispatchDefaultFunc':
> conf/domain_event.c:1198:30: error: cast increases required alignment of
> target type [-Werror=cast-align]
> conf/domain_event.c:1314:34: error: cast increases required alignment of
> target type [-Werror=cast-align]
> cc1: all warnings being treated as errors
>
> Using ATTRIBUTE_PACKED we force a structure to not follow architecture and
> compiler best alignments.
NACK; I'd rather go with the union approach, because ATTRIBUTE_PACKED
risks putting things on non-clean boundaries which may then interfere
with attempts to do atomic operations on fields that a subclass may add.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131212/2c25acab/attachment-0001.sig>
More information about the libvir-list
mailing list