#4510 assigned defect

Fix ILP32 multilib variant in newlib for AArch64

Reported by: Ryan Long Owned by: Sebastian Huber
Priority: normal Milestone: 6.1
Component: arch/aarch64 Version: 6
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description (last modified by Joel Sherrill)

This flag is needed to force the generation of AArch64 assembly from C sources instead of using the hand-optimized code in newlib. The existing hand-optimized code has bugs for ILP32. There are multiple technical options to address this and lots of discussion:

  • Update newlib from upstream ARM source code
  • Add -DPREFER_SIZE_OVER_SPEED and always use C versions on aarch64
  • Fix existing code

Attachments (3)

0001-configure.host-Add-DPREFER_SIZE_OVER_SPEED.patch (1.3 KB) - added by Ryan Long on 09/03/21 at 12:31:34.
0001-aarch64-Add-ILP32-ABI-support-in-assembly.patch (10.8 KB) - added by Ryan Long on 09/10/21 at 21:42:33.
0001-aarch64-Add-ILP32-ABI-support-in-assembly-v2.patch (10.8 KB) - added by Kinsey Moore on 03/17/22 at 21:17:26.
Fix patch for current newlib

Download all attachments as: .zip

Change History (17)

comment:1 Changed on 09/03/21 at 16:36:21 by Ryan Long

This patch is only temporary. It will be removed once it is fixed upstream.

comment:2 Changed on 09/07/21 at 22:56:37 by Chris Johns

Who is fixing the upstream?

I have not been following newlib so is there a link to the discussion about this?

comment:3 in reply to:  2 Changed on 09/08/21 at 13:25:42 by Ryan Long

Replying to Chris Johns:

Who is fixing the upstream?

Kinsey has already gotten a fix merged with ARM. Newlib hasn't pulled those changes in yet though.

I have not been following newlib so is there a link to the discussion about this?

Here are the links to the discussions

https://sourceware.org/pipermail/newlib/2020/017781.html
https://sourceware.org/pipermail/newlib/2020/018169.html
https://sourceware.org/pipermail/newlib/2020/018197.html

Last edited on 09/08/21 at 13:54:40 by Ryan Long (previous) (diff)

comment:4 Changed on 09/09/21 at 08:28:12 by Chris Johns

As discussed on devel@ the ILP32 support should be fixed or patched in newlib and we should not cause an performance regressions for LP64 targets.

comment:5 Changed on 09/09/21 at 13:42:54 by Joel Sherrill

Description: modified (diff)
Summary: Add -DPREFER_SIZE_OVER_SPEED for AArch64 buildsFix ILP32 multilib variant in newlib for AArch64

comment:6 Changed on 09/20/21 at 20:37:49 by Ryan Long <ryan.long@…>

In 0e54d58/rtems-source-builder:

rtems-gcc-10-newlib-head.cfg: Add newlib patch

Adds patch to add sanitation to the padding of bits and size_t types for
AArch64 tools builds with newlib. These changes have been made in ARM, but
newlib has yet to pull them. This can be removed once newlib has pulled
the code.

Updates #4510

comment:7 Changed on 09/20/21 at 20:37:52 by Ryan Long <ryan.long@…>

In 3950b1e/rtems-source-builder:

rtems-gcc-head-newlib-head.cfg: Add newlib patch

Adds patch to add sanitation to the padding of bits and size_t types for
AArch64 tools builds with newlib. These changes have been made in ARM, but
newlib has yet to pull them. This can be removed once newlib has pulled
the code.

Updates #4510

comment:8 Changed on 12/16/21 at 15:56:03 by Kinsey Moore

Resolution: fixed
Status: newclosed

This has been verified as fixed thanks to Ryan's patches.

Changed on 03/17/22 at 21:17:26 by Kinsey Moore

Fix patch for current newlib

comment:9 Changed on 03/17/22 at 21:53:24 by Kinsey Moore

Resolution: fixed
Status: closedreopened

Reopening this since it needs to be tracked until the patch is merged with newlib from the upstream optimized-routines repo.

comment:10 Changed on 11/29/22 at 23:04:24 by Chris Johns

Milestone: 6.17.1
Version: 67

Moved until ARM adds a correct patch to newlib.

comment:11 Changed on 07/27/23 at 15:01:56 by Sebastian Huber

Milestone: 7.16.1
Owner: set to Sebastian Huber
Status: reopenedassigned
Version: 76

I guess you can wait forever if you want ARM to get this fixed. There are open issues in the ARM code:

https://github.com/ARM-software/optimized-routines/issues/56

https://github.com/ARM-software/optimized-routines/pull/57

comment:12 Changed on 07/27/23 at 15:11:38 by Kinsey Moore

I've actually had some luck getting changes into optimized-routines. The hard part is getting them merged into newlib.

comment:13 Changed on 07/27/23 at 15:12:55 by Sebastian Huber

I prepared some patches for Newlib, however, there is this open issue with the notes.

comment:14 Changed on 11/22/23 at 06:12:50 by Sebastian Huber <sebastian.huber@…>

In 07be298/rtems-source-builder:

6/7: Update Newlib

Pick up fixes for ARM/optimized-routines and the memory reclamation at thread
exit.

Update #4510.
Update #4967.

Note: See TracTickets for help on using tickets.