[PATCH v2 0/7] selftests/nolibc: customize CROSS_COMPILE for all supported architectures

From: Zhangjin Wu
Date: Fri Aug 11 2023 - 16:27:16 EST


Hi, Willy

Here is v2 of the customized CROSS_COMPILE support, this helps a lot
during the testing of the other cross-arch nolibc changes:

$ ARCHS="i386 x86_64 arm64 arm mips ppc ppc64 ppc64le riscv s390"
$ for arch in ${ARCHS[@]}; do printf "%9s: " $arch; make run-user XARCH=$arch | grep status; done

Based on your suggestion, we did this changes:

- The qemu notes patch [1] is removed, welcome your doc file ;-)
- Arnd's crosstools are customized by default
- Import cc-cross-prefix to support local cross toolchains too
- Use mips64 toolchains for mips like x86_64 toolchains for i386, allow
download less toolchains
- Use HOSTCC for libc-test compiling

Changes from v1 --> v2:

* selftests/nolibc: allow use x86_64 toolchain for i386

No change.

* selftests/nolibc: allow use mips64 toolchain for mips

Allow download less toolchains, save time save storage space

* selftests/nolibc: libc-test: use HOSTCC instead of CC

libc-test is mainly for local test, use HOSTCC

* selftests/nolibc: allow customize CROSS_COMPILE by architecture

Moved the ../../../scripts/Makefile.include after our customized
CROSS_COMPILE, to let it prefix CC with $(CROSS_COMPILE) for us.

* selftests/nolibc: customize CROSS_COMPILE for all architectures

Use Arnd's crosstools as the default ones

* selftests/nolibc: import cc-cross-prefix macro
selftests/nolibc: allow use cross toolchains from software repository

Import cc-cross-prefix to allow customize a list of the cross
compilers, the ones from local repositories are appended in.

If already installed ones from local repos, why not use them, let's
do it.

Willy, since this series is really important to test the coming
patchsets, I send it here before the others to simplify the testing, but
we can delay its review, it is not urgent.

And here [2] is the simple script I wrote to download, decompress and
configure the PATH variable for Anrd's crosstools, hope it helps.

Best regards,
Zhangjin Wu
---
[1]: https://lore.kernel.org/lkml/6de680acbc2d87e13a680d4453ef022568bf489b.1691263493.git.falcon@xxxxxxxxxxx/
[2]: https://gitee.com/tinylab/linux-lab/blob/next/tools/nolibc/crosstool.sh
v1: https://lore.kernel.org/lkml/cover.1691263493.git.falcon@xxxxxxxxxxx/

Zhangjin Wu (7):
selftests/nolibc: allow use x86_64 toolchain for i386
selftests/nolibc: allow use mips64 toolchain for mips
selftests/nolibc: libc-test: use HOSTCC instead of CC
selftests/nolibc: allow customize CROSS_COMPILE by architecture
selftests/nolibc: customize CROSS_COMPILE for all architectures
selftests/nolibc: import cc-cross-prefix macro
selftests/nolibc: allow use cross toolchains from software repository

tools/testing/selftests/nolibc/Makefile | 38 +++++++++++++++++++++----
1 file changed, 33 insertions(+), 5 deletions(-)

--
2.25.1