diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2021-12-27 19:26:04 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2021-12-27 21:08:58 +0100 |
commit | c96f0a97ce0d446635a048fb2c9f301d587fc0fd (patch) | |
tree | 851630ba57db0056628e3ef5da6c4633ea8153ba | |
parent | 5bd3ded167473188fabd26dceb9c3574b056fb84 (diff) | |
download | klibc-maint-c96f0a97ce0d446635a048fb2c9f301d587fc0fd.tar.gz |
test-many-klibc: Always use GNU ld for riscv64, s390x, and sparc64
* LLD 13 doesn't implement linker relaxation for RISC-V, which makes
it fairly useless. Having made relaxation work, I don't want to go
back and make it conditional.
* LLD 13 doesn't seem to handle SPARC-specific relocations yet.
* Debian's build of LLD 13 doesn't seem to include IBM Z (s390x)
support.
So introduce a "mixed" toolchain of Clang + GNU ld, and test that
instead of pure LLVM for these architectures.
-rwxr-xr-x | test-many-klibcs | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/test-many-klibcs b/test-many-klibcs index 2c82822..13ddce2 100755 --- a/test-many-klibcs +++ b/test-many-klibcs @@ -40,6 +40,25 @@ build_llvm() { || return } +# Some architectures have Clang but limited or missing LLD support. +# The "mixed" toolchain is Clang + GNU ld. +build_mixed() { + echo "I: Using $(clang --version | head -1)" + echo "I: Using $("$toolsarch-ld" --version | head -1)" + + mkdir -p "build/mixed-$toolsarch" + echo "I: Generating kernel UAPI headers for ARCH=$kernelarch" + make -C ../linux "ARCH=$kernelarch" \ + "INSTALL_HDR_PATH=$PWD/build/mixed-$toolsarch/linux" headers_install \ + || return + echo "I: Building with ARCH=$arch CROSS_COMPILE=$toolsarch- CC='clang -target $toolsarch' HOSTCC=clang ${makeflags[*]}" + make -C "build/mixed-$toolsarch" -f "$PWD/../klibc/Makefile" -j"$nproc" \ + "ARCH=$arch" "CROSS_COMPILE=$toolsarch-" "KBUILD_SRC=$PWD/../klibc" \ + "CC=clang -target $toolsarch" "HOSTCC=clang" "${makeflags[@]}" \ + all test \ + || return +} + clean() { echo "I: Cleaning" (cd ../klibc && git clean -d -f -x) @@ -214,7 +233,7 @@ Usage: test-many-klibcs [OPTIONS] Options: --architecture KLIBC-ARCH --kernel-architecture KERNEL-ARCH - --tools gnu|llvm + --tools gnu|llvm|mixed --tools-architecture GNU-TRIPLET' limit_arch= @@ -303,15 +322,15 @@ process ppc64 powerpc llvm powerpc64-linux-gnu ppc64 process ppc64 powerpc gnu powerpc64le-linux-gnu ppc64le process ppc64 powerpc llvm powerpc64le-linux-gnu ppc64le process riscv64 riscv gnu riscv64-linux-gnu riscv64 -process riscv64 riscv llvm riscv64-linux-gnu riscv64 +process riscv64 riscv mixed riscv64-linux-gnu riscv64 # 32-bit s390 is no longer supported in Debian. #process s390 s390 gnu s390-linux-gnu s390 process s390x s390 gnu s390x-linux-gnu s390x -process s390x s390 llvm s390x-linux-gnu s390x +process s390x s390 mixed s390x-linux-gnu s390x process sh sh gnu sh4-linux-gnu sh4 process sparc sparc gnu sparc64-linux-gnu sparc32plus LD="sparc64-linux-gnu-ld -m elf32_sparc" process sparc64 sparc gnu sparc64-linux-gnu sparc64 -process sparc64 sparc llvm sparc64-linux-gnu sparc64 +process sparc64 sparc mixed sparc64-linux-gnu sparc64 process x86_64 x86 gnu x86_64-linux-gnu x86_64 process x86_64 x86 llvm x86_64-linux-gnu x86_64 |