lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3ec048008a9b2c1ed7406214c6899e5412a97596.1691263493.git.falcon@tinylab.org>
Date:   Sun,  6 Aug 2023 03:44:29 +0800
From:   Zhangjin Wu <falcon@...ylab.org>
To:     w@....eu
Cc:     falcon@...ylab.org, linux-kernel@...r.kernel.org,
        linux-kselftest@...r.kernel.org, tanyuan@...ylab.org,
        thomas@...ch.de
Subject: [PATCH v1 2/4] selftests/nolibc: customize CROSS_COMPILE for many architectures

This simplifies the 'make' commands for most of nolibc supported
architectures, only requires the XARCH option now.

Almost all distributions provide qemu and toolchains for i386, x86_64,
arm64, arm, mips, riscv and s390, let's customize the local toolchains
for them. The fresh new loongarch is an exception, which is not covered
here.

If want to use another toolchain which is not customized here, we can
also pass CROSS_COMPILE, CROSS_COMPILE_$(XARCH) and even CC from command
line.

After carefully install and configure $(CROSS_COMPILE_$(XARCH)) and
qemu-$(XARCH), it is able to run tests for the architectures or their
variants like this:

    $ 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
         i386: 165 test(s): 157 passed,   8 skipped,   0 failed => status: warning
       x86_64: 165 test(s): 157 passed,   8 skipped,   0 failed => status: warning
        arm64: 165 test(s): 157 passed,   8 skipped,   0 failed => status: warning
          arm: 165 test(s): 156 passed,   9 skipped,   0 failed => status: warning
         mips: 165 test(s): 156 passed,   9 skipped,   0 failed => status: warning
          ppc: 165 test(s): 157 passed,   8 skipped,   0 failed => status: warning
        ppc64: 165 test(s): 157 passed,   8 skipped,   0 failed => status: warning
      ppc64le: 165 test(s): 157 passed,   8 skipped,   0 failed => status: warning
        riscv: 165 test(s): 156 passed,   9 skipped,   0 failed => status: warning
         s390: 165 test(s): 156 passed,   9 skipped,   0 failed => status: warning

[1]: https://mirrors.edge.kernel.org/pub/tools/crosstool/

Signed-off-by: Zhangjin Wu <falcon@...ylab.org>
---
 tools/testing/selftests/nolibc/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index e2b02761ad44..d32694656221 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -56,9 +56,17 @@ IMAGE            = $(IMAGE_$(XARCH))
 IMAGE_NAME       = $(notdir $(IMAGE))
 
 # CROSS_COMPILE: cross toolchain prefix by architecture
+CROSS_COMPILE_i386      ?= x86_64-linux-gnu-
+CROSS_COMPILE_x86_64    ?= x86_64-linux-gnu-
+CROSS_COMPILE_x86       ?= x86_64-linux-gnu-
+CROSS_COMPILE_arm64     ?= aarch64-linux-gnu-
+CROSS_COMPILE_arm       ?= arm-linux-gnueabi-
+CROSS_COMPILE_mips      ?= mipsel-linux-gnu-
 CROSS_COMPILE_ppc       ?= powerpc-linux-gnu-
 CROSS_COMPILE_ppc64     ?= powerpc64le-linux-gnu-
 CROSS_COMPILE_ppc64le   ?= powerpc64le-linux-gnu-
+CROSS_COMPILE_riscv     ?= riscv64-linux-gnu-
+CROSS_COMPILE_s390      ?= s390x-linux-gnu-
 CROSS_COMPILE           ?= $(CROSS_COMPILE_$(XARCH))
 
 # make sure CC is prefixed with CROSS_COMPILE
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ