On Fri, Jul 23, 2021 at 11:14:47AM -0300, Adhemerval Zanella wrote:
On 23/07/2021 10:30, Joey Ye wrote:
Hi toolchain experts,
Is there any BKM or build script that can build AArch64 ILP32 glibc? Sincerely appreciate any help from Linaro.
Thanks, Joey
Hi Joey,
Since ILP32 support is out-of-tree you will need to setup some branches. As fair I know both binutils and gcc have upstream support, so there is no need to use different branches. The gcc might lack some specific support that interacts with kernel/glibc, such as sanitizers (I recall that my initial approach of fixing it was not accepted on LLVM side because we lack upstream support).
You will also need an out-of-tree kernel branch as well. The latest one from arm development repository [1] only supports up to v5.1.
I'd recommend fo use this branch since it has seccomp fix. https://github.com/norov/linux/commits/ilp32-5.2
On glibc side we have the arm initial work on arm/ilp32 which supports up to version 2.30 [2]. Andreas Schwab keeps a personal branch which I think he uses internally on SuSE that he keeps updated. The last on schwab/ilp32-2.33 [3] supports glibc 2.33 and I take he does run some regressions tests (not sure though).
For scripting, you can use the glibc build-many-glibcs.py [4] to build a complete toolchain along with a basic sysroot. The script is build to use per-determined versions and branches (usually the latest available one), but you can hack into the source folders and change it. The script work outside glibc source also.
To build a gcc 11, binutils 2.35, linux v5.1, glibc 2.33 toolchain you might do:
$ build-many-glibcs.py /path/to/workdir checkout $ build-many-glibcs.py /path/to/workdir host-libraries $ cd /path/to/workdir/src $ mv linux linux-pkg $ git clone --single-branch --branch staging/ilp32-5.1 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git $ cd glibc && git checkout -b schwab/ilp32-2.33 origin/schwab/ilp32-2.33 $ build-many-glibcs.py /path/to/workdir compilers aarch64-linux-gnu-ilp32
The complete toolchain will be on '/path/to/workdir/install/compilers/aarch64-linux-gnu-ilp32/'. The default configuration for build-many-glibcs.py build a simple toolchain without some gcc options meant to be used for glibc development. It means only C and C++ support, no sanititzer, no multilib, no offload support, etc. You can use the build-many-glibc.py '--full-gcc' option to enable all gcc languages and sanitizers, but to add any other option you will need to hack into the script.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git [2] https://sourceware.org/git/?p=glibc.git%3Ba=shortlog%3Bh=refs/heads/arm/ilp3... [3] https://sourceware.org/git/?p=glibc.git%3Ba=shortlog%3Bh=refs/heads/schwab/i... [4] https://sourceware.org/git/?p=glibc.git%3Ba=blob%3Bf=scripts/build-many-glib... _______________________________________________ linaro-toolchain mailing list linaro-toolchain@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-toolchain