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: <b06de47989e3138de3d178da0d705ad6560924ec.1691783604.git.falcon@tinylab.org>
Date:   Sat, 12 Aug 2023 04:34:55 +0800
From:   Zhangjin Wu <falcon@...ylab.org>
To:     falcon@...ylab.org, w@....eu
Cc:     linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
        tanyuan@...ylab.org, thomas@...ch.de
Subject: [PATCH v2 7/7] selftests/nolibc: allow use cross toolchains from software repository

This allows users to install and use cross toolchains from local
software repositories.

The prefixes of local cross toolchains are appended to the
CROSS_COMPILE_$(XARCH) list, cc-cross-prefix is called to search this
list and return the first <prefix> where a <prefix>gcc is found in PATH.

Since different distributions have different prefixes, here only adds
the frequently used ones.

To use more prefixes not listed in Makefile, please put the lines as
following in your script and load it with a 'source' command:

    export CROSS_COMPILE_i386="x86_64-linux-"
    export CROSS_COMPILE_x86_64="x86_64-linux-"
    export CROSS_COMPILE_x86="x86_64-linux-"
    export CROSS_COMPILE_arm64="aarch64-linux-"
    export CROSS_COMPILE_arm="arm-linux-gnueabi-"
    export CROSS_COMPILE_mips="mips64-linux-"
    export CROSS_COMPILE_ppc="powerpc64-linux-"
    export CROSS_COMPILE_ppc64="powerpc64-linux-"
    export CROSS_COMPILE_ppc64le="powerpc64-linux-"
    export CROSS_COMPILE_riscv="riscv64-linux-"
    export CROSS_COMPILE_s390="s390-linux-"
    export CROSS_COMPILE_loongarch="loongarch64-linux-"

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

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 7687988c780b..ef2507f12e24 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -59,24 +59,25 @@ IMAGE_NAME       = $(notdir $(IMAGE))
 # Notes,
 # - The small, newest and obtainable cross toolchains from [1] are recommended,
 #   Please download, decompress and add the bin/ path to 'PATH' env variable
+# - The frequently used prefixes are added for local cross toolchains
 # - To use another cross compiler, pass 'CROSS_COMPLE', 'CROSS_COMPILE_$(XARCH)'
 #   by variant or even 'CC' from command line
 #
 # [1]: https://mirrors.edge.kernel.org/pub/tools/crosstool/
 
-CROSS_COMPILE_i386      ?= x86_64-linux-
-CROSS_COMPILE_x86_64    ?= x86_64-linux-
-CROSS_COMPILE_x86       ?= x86_64-linux-
-CROSS_COMPILE_arm64     ?= aarch64-linux-
-CROSS_COMPILE_arm       ?= arm-linux-gnueabi-
-CROSS_COMPILE_mips      ?= mips64-linux-
-CROSS_COMPILE_ppc       ?= powerpc64-linux-
-CROSS_COMPILE_ppc64     ?= powerpc64-linux-
-CROSS_COMPILE_ppc64le   ?= powerpc64-linux-
-CROSS_COMPILE_riscv     ?= riscv64-linux-
-CROSS_COMPILE_s390      ?= s390-linux-
+CROSS_COMPILE_i386      ?= x86_64-linux- x86_64-linux-gnu-
+CROSS_COMPILE_x86_64    ?= x86_64-linux- x86_64-linux-gnu-
+CROSS_COMPILE_x86       ?= x86_64-linux- x86_64-linux-gnu-
+CROSS_COMPILE_arm64     ?= aarch64-linux- aarch64-linux-gnu-
+CROSS_COMPILE_arm       ?= arm-linux-gnueabi- arm-none-eabi-
+CROSS_COMPILE_mips      ?= mips64-linux- mips64el-linux-gnuabi64-
+CROSS_COMPILE_ppc       ?= powerpc64-linux- powerpc-linux-gnu-
+CROSS_COMPILE_ppc64     ?= powerpc64-linux- powerpc64le-linux-gnu-
+CROSS_COMPILE_ppc64le   ?= powerpc64-linux- powerpc64le-linux-gnu-
+CROSS_COMPILE_riscv     ?= riscv64-linux- riscv64-linux-gnu-
+CROSS_COMPILE_s390      ?= s390-linux- s390x-linux-gnu-
 CROSS_COMPILE_loongarch ?= loongarch64-linux-
-CROSS_COMPILE           ?= $(CROSS_COMPILE_$(XARCH))
+CROSS_COMPILE           ?= $(call cc-cross-prefix,$(CROSS_COMPILE_$(XARCH)))
 
 # Make CC is always prefixed with $(CROSS_COMPILE)
 include ../../../scripts/Makefile.include
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ