[yocto] binutils 2.29.1 ARM Thumb kernel problem

Chris Elledge celledge at digitallumens.com
Wed Apr 4 08:06:58 PDT 2018


Thanks for the feedback. I rolled back binutils to 2.28.0 by copying the
yocto-2.3.3 binutils recipe directory into my custom layer. That has
resolved the issue.

I can confirm that binutils 2.29.0 also has the problem. I went from
yocto-2.3 to 2.4.2 so I hadn't tried binutils 2.29.0 previously. There are
also reports that openssl and libavcodec are broken when targeting an ARM
Thumb2 platform with binutils 2.29.*

-Chris

On Mon, Apr 2, 2018 at 7:14 PM, Andre McCurdy <armccurdy at gmail.com> wrote:

> On Mon, Apr 2, 2018 at 1:15 PM, Chris Elledge
> <celledge at digitallumens.com> wrote:
> > I recently upgraded my Yocto based project to Yocto 2.4.2, and I
> encountered
> > a problem when building my custom kernel for an AT91 SAMA5D3X platform.
> I've
> > been using an ARM Thumb2 kernel for a while successfully until this
> release.
> > It appears that the issue stems from the change to binutils version
> 2.29.1.
> >
> > Here's a good description of the problem:
> > https://patchwork.kernel.org/patch/10072695/
> >
> > I tried out their test script, and it flagged the arm-poky-linux-gnueabi-
> > toolchain built by Yocto 2.4.2 as being buggy. Has anyone else
> encountered
> > this problem and figured out a way around it without disabling Thumb
> > compilation of the kernel?
>
> Thanks for bringing up this issue. Reading through the various bug
> reports etc it not clear what the fix should be. Upstream binutils has
> not reverted the change and the upstream kernel still appears to rely
> on the pre-2.29.1 binutils behaviour.
>
> The simplest solution for OE 2.4 would seem to be to revert the change
> in binutils (rev e645cf4, which was added very close to the 2.29.1
> release).
>
> Longer term, it looks like the kernel will have to be updated to work
> with the most recent versions of binutils. A possible approach for
> that is hinted at in the kernel patch you provided a link for, ie
> update the "badr" macro in arch/arm/include/asm/assembler.h to OR the
> sym address with 1 instead of adding 1. e.g. something like changing:
>
>   #ifdef CONFIG_THUMB2_KERNEL
>   adr\c \rd, \sym + 1
>   #else
>
> to
>
>   #ifdef CONFIG_THUMB2_KERNEL
>   adr\c \rd, \sym
>   orr\c \rd, \rd, #1
>   #else
>
> The fact that it doesn't seem to have been fixed that way in the
> upstream kernel suggests that the kernel developers may be hoping to
> find a better solution though (ie one which avoids adding an extra
> instruction in the syscall fast path).
>
> So, without some more guidance from either upstream project, the best
> solution isn't clear. Perhaps you could try reverting the binutils
> change to get you up and running again in the short term and then ask
> on the ARM kernel mailing lists what the solution for Thumb2 with
> binutils >= 2.29.1 is expected to be?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20180404/7f1fd10b/attachment.html>


More information about the yocto mailing list