Skip to content

Add ILP32 support in aarch64

Gustavo Zacarias buildroot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 5 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 5 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Buildroot] [PATCH 0/5] Add ILP32 support in aarch64
Quoted 11 lines · Zhang Jian(Bamvor)

LP64 is the default ABI on arm64(Implies -mabi=lp64 while compiling), and the kernel remains in LP64 no matter ILP32 enables or not.

These series patches introduce the big endian support in aarch64 and then add ILP32 special filename and menuconfig step by step.

The test of build is based on linaro kernel [1] and toolchain built by linaro ABE environment[2].

This is my first time I try to contribute the buildroot, feedback is very appreciated. Sorry if there are some coding style issues.

Hi.
A couple of issues i've discovered with this patchset are:

1) You're using -mabi unconditionally.
Current default gcc is 4.8.x which doesn't understand -mabi for aarch64.

2) You're not taking care of the internal toolchain backend for ILP32. Currently we default to gcc 4.8.x which doesn't handle ilp32 at all hence errors out for aarch64 in that configuration (doesn't understand -mabi, point 1).
The proper action would be to lock down available versions in package/gcc/Config.in.host via "depends on !BR2_AARCH64_ILP32" (basically just for 4.8.x since previous versions are already locked out for aarch64 in general).
This will only fix the ILP32 problem, doesn't help for -mabi=lp64 though (point 1).

3) ILP32 little endian doesn't build with gcc 4.9.x/binutils 2.25/glibc 2.20: it results in an internal compiler error while building glibc, so very likely gcc's fault. This should be handled as well, by fixing it or disabling the internal toolchain backend for this combination.

3) Big endian support is broken for the internal toolchain. The glibc package isn't enabled for aarch64 BE, so basically it builds a toolchain without a libc, not nice.
Fix in toolchain/toolchain-buildroot/Config.in - add appropiate BR2_aarch64_be depends.

4) We don't know/have any external toolchains to test this. Suggestions? :)

5) You're not setting KERNEL_ARCH appropiately for big endian, right now the regex is: -e s/aarch64/arm64/
It should be: -e s/aarch64.*/arm64/
Otherwise we end up with KERNEL_ARCH being arm64_be which obviously fails badly, not only for kernel builds, but also for internal toolchains builds (headers), possibly some packages and linux extensions. Fix in top Makefile.

There are probably other details missing, these are the quick/big ones i could see.

Regards.