ARM: Structure size boundary

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Dec 9 13:19:40 UTC 2009


Hi,

most ARM BSPs add -mstructure-size-boundary=8 to the CFLAGS.  This changes the
structure size boundary from 32 bit (GCC default value) to 8 bit.  From the GCC
manual we have:

The size of all structures and unions will be rounded up to a multiple of the
number of bits set by this option. Permissible values are 8, 32 and 64. The
default value varies for different toolchains. For the COFF targeted toolchain
the default value is 8. A value of 64 is only allowed if the underlying ABI
supports it. Specifying the larger number can produce faster, more efficient
code, but can also increase the size of the program. Different values are
potentially incompatible. Code compiled with one value cannot necessarily
expect to work with code or libraries compiled with another value, if they
exchange information using structures or unions.

So now we have a problem that the BSP uses 8 and Newlib is built with 32.  The
next problem is that it seems that the network stack requires a value of 8.  I
removed this option from an ARM BSP and notices invalid ARP request packages on
the network.  NetBSD uses also a value of 8 in the GCC sources.  We should fix
this.  We have two options:

1. Set the default structure size to 8 in the GCC sources for RTEMS (like in
NetBSD).

2. Fix the network stack.

Have a nice day!

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list