[OE-core] [PATCH V2] musl: Fix dirent struct alignment issue seen on armv5te

Andrea Adami andrea.adami at gmail.com
Thu Aug 2 12:28:35 UTC 2018


On Thu, Aug 2, 2018 at 11:49 AM, Andre McCurdy <armccurdy at gmail.com> wrote:
> On Thu, Aug 2, 2018 at 2:10 AM, Khem Raj <raj.khem at gmail.com> wrote:
>> On Thu, Aug 2, 2018 at 12:47 AM Andre McCurdy <armccurdy at gmail.com> wrote:
>>>
>>> On Thu, Aug 2, 2018 at 12:11 AM, Khem Raj <raj.khem at gmail.com> wrote:
>>> > fix internal linux headers
>>> >
>>> > Full logs
>>> > https://git.musl-libc.org/cgit/musl/log/?qt=range&q=9cad27a3dc1a4eb349b6591e4dc8cc89dce32277..f2c6dbe2442027ed8fe0fa869918e41f495534d8
>>>
>>> From the musl commit which fixed the dirent struct alignment issues it
>>> doesn't look like it was armv5te specific, so mentioning armv5te in
>>> the commit message could be misleading.
>>>
>>>   https://git.musl-libc.org/cgit/musl/commit/?id=b3fa0f2b1b8c267c1cbe8c62464e484f3a174a4e
>>>
>>
>> commit is in contextual to OE on a particular arch where it was
>> observed, other arches either have
>> ways to compensate for misaligned access in hardware or compiler does
>> not use 8byte alignment
>>  thats why subject says 'seen'
>

Hi,
I have seen scary align traps in dmesg and bisected back to that musl commit.

Short version: never break alignment for structures used for streaming data

Long version: afais only on armv5(t)e , with DSP feature, the code of
readdir.c is miscompiled by gcc when using O2, O3, Os.
What happens is, the arm  ldrd instruction has specific contraints on
armv5(t)e, one of them is the address must be 8 bytes aligned (
doubleword-aligned for doubleword transfers).
Interestingly, other toolchains for armv5 were patched to avoid
ldrd/strd alltogether.

Cheers
Andrea


> Great explanation. That's the kind of information which should go in
> the commit message.
>
>>> > Signed-off-by: Khem Raj <raj.khem at gmail.com>
>>> > ---
>>> >  meta/recipes-core/musl/musl_git.bb | 2 +-
>>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>>> >
>>> > diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
>>> > index b56870cb3f..e7d0e1a66b 100644
>>> > --- a/meta/recipes-core/musl/musl_git.bb
>>> > +++ b/meta/recipes-core/musl/musl_git.bb
>>> > @@ -3,7 +3,7 @@
>>> >
>>> >  require musl.inc
>>> >
>>> > -SRCREV = "9cad27a3dc1a4eb349b6591e4dc8cc89dce32277"
>>> > +SRCREV = "f2c6dbe2442027ed8fe0fa869918e41f495534d8"
>>> >
>>> >  PV = "1.1.19+git${SRCPV}"
>>> >
>>> > --
>>> > 2.18.0
>>> >
>>> > --
>>> > _______________________________________________
>>> > Openembedded-core mailing list
>>> > Openembedded-core at lists.openembedded.org
>>> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list