From nobody Wed Dec 31 10:36:14 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E779C0018A for ; Sun, 5 Nov 2023 10:10:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229993AbjKEKKN (ORCPT ); Sun, 5 Nov 2023 05:10:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjKEKKM (ORCPT ); Sun, 5 Nov 2023 05:10:12 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 061E0E1; Sun, 5 Nov 2023 02:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699179007; bh=AVSI3iU8EOjAQAr1auwQ6ceFLr1ULSrPhBv72fpFr7k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kcRymekrTVhD86tT67H4xUlFGRYr3jRRPASht/myx8stRQHYPYXC1o7mWISFW4jno MOtLEX8i6kesQD5dxgZm1Jl7hnARkMuoSIYAMWsWtNnZzTO3d1t7DuPumUwCkUlRUr DUXz2iRhwKZ5S7wb6b3W/ycWPRNEJbGKNvtGL2EE= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 11:09:55 +0100 Subject: [PATCH 1/6] tools/nolibc: error out on unsupported architecture MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20231105-nolibc-mips-be-v1-1-6c2ad3e50a1f@weissschuh.net> References: <20231105-nolibc-mips-be-v1-0-6c2ad3e50a1f@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v1-0-6c2ad3e50a1f@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699179006; l=803; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=AVSI3iU8EOjAQAr1auwQ6ceFLr1ULSrPhBv72fpFr7k=; b=jlLtqmMRpQ60zNE3gOr2zSIQYq7SbbtUurG3tfEGmKWKXsV8B8NPZol5S2FdhjzAa4IMrTAGW MLYtCADmZjaBVSKD9kFYxZ5P3OJxuWxZWI+1kmVQcdoNg1LPS6cKy0m X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When an architecture is unsupported arch.h would silently continue. This leads to a lot of followup errors because my_syscallX() is not defined and the startup code is missing. Avoid these confusing errors and fail the build early with a clear error message and location. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Willy Tarreau --- tools/include/nolibc/arch.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/include/nolibc/arch.h b/tools/include/nolibc/arch.h index e276fb0680af..2f72ccac0378 100644 --- a/tools/include/nolibc/arch.h +++ b/tools/include/nolibc/arch.h @@ -33,6 +33,8 @@ #include "arch-s390.h" #elif defined(__loongarch__) #include "arch-loongarch.h" +#else +#error Unsupported Architecture #endif =20 #endif /* _NOLIBC_ARCH_H */ --=20 2.42.1 From nobody Wed Dec 31 10:36:14 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49171C4332F for ; Sun, 5 Nov 2023 10:17:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230287AbjKEKKV (ORCPT ); Sun, 5 Nov 2023 05:10:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbjKEKKM (ORCPT ); Sun, 5 Nov 2023 05:10:12 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A6F8F2; Sun, 5 Nov 2023 02:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699179007; bh=HOKeEAIHMRYfVoon/mx+VWMcYYNPi3QtyuybV2q/R1I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=TsSorgX97xNatwFxA4FeECynO20C515J5PA2JRQ8E23GMkXpVgR/a5/emu9oji8pL 9J42v5gnVMfI6lktw+stcfVpJX9Ak//Gwlnp1Qo+4HrLqvAB0LvJQuw9MBrctREJ4n v9tUaqcjNIgrezjRalQqZOCMkJwr3TqaVcMqgQrM= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 11:09:56 +0100 Subject: [PATCH 2/6] tools/nolibc: move MIPS ABI validation into arch-mips.h MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20231105-nolibc-mips-be-v1-2-6c2ad3e50a1f@weissschuh.net> References: <20231105-nolibc-mips-be-v1-0-6c2ad3e50a1f@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v1-0-6c2ad3e50a1f@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699179006; l=1401; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=HOKeEAIHMRYfVoon/mx+VWMcYYNPi3QtyuybV2q/R1I=; b=MAgipq15jOEiqliN00Hv04vNzZtIZ/jtOirHmetvf88ps3RKyanGwpHI08fmejygPHz/3z5sz MCiKkAx0jbXAloCtLPrPlnUvQpa5sKdWeiLFHe6Z5K4yYnUqwWNKl5a X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When installing nolibc to a sysroot arch.h is not used so its ABI check is bypassed. This makes is possible to compile nolibc with a non O32 ABI which may build but can not run. Move the check into arch-mips.h so it will always be evaluated. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Willy Tarreau --- tools/include/nolibc/arch-mips.h | 4 ++++ tools/include/nolibc/arch.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/include/nolibc/arch-mips.h b/tools/include/nolibc/arch-m= ips.h index 4ab6fa54beee..3a2c76716b83 100644 --- a/tools/include/nolibc/arch-mips.h +++ b/tools/include/nolibc/arch-mips.h @@ -10,6 +10,10 @@ #include "compiler.h" #include "crt.h" =20 +#if !defined(_ABIO32) +#error Unsupported MIPS ABI +#endif + /* Syscalls for MIPS ABI O32 : * - WARNING! there's always a delayed slot! * - WARNING again, the syntax is different, registers take a '$' and nu= mbers diff --git a/tools/include/nolibc/arch.h b/tools/include/nolibc/arch.h index 2f72ccac0378..c8f4e5d3add9 100644 --- a/tools/include/nolibc/arch.h +++ b/tools/include/nolibc/arch.h @@ -23,7 +23,7 @@ #include "arch-arm.h" #elif defined(__aarch64__) #include "arch-aarch64.h" -#elif defined(__mips__) && defined(_ABIO32) +#elif defined(__mips__) #include "arch-mips.h" #elif defined(__powerpc__) #include "arch-powerpc.h" --=20 2.42.1 From nobody Wed Dec 31 10:36:14 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DE8BC4167D for ; Sun, 5 Nov 2023 10:17:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230222AbjKEKKT (ORCPT ); Sun, 5 Nov 2023 05:10:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229739AbjKEKKM (ORCPT ); Sun, 5 Nov 2023 05:10:12 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C9ACEB; Sun, 5 Nov 2023 02:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699179007; bh=eTORcR+pRc30ECZqg+vICxSGsI/8LMSk3yiX/z1LA/E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ue7oQ/chgAThAfuLZ9G74lep4J9+8CFxScbIM9afAtk5epaU2T9ixsfWr99B1wBii KtAFz084hMAMGHJ9L3r1H0Ox1bwMvXdrVOY8pqgMriBcJzElC69j/2zPBWy9iQ5Jft 3kCTyt2NPlrKZTpz/LvcZAlJvRjxoXAkyVwNajU8= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 11:09:57 +0100 Subject: [PATCH 3/6] selftests/nolibc: use XARCH for MIPS MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20231105-nolibc-mips-be-v1-3-6c2ad3e50a1f@weissschuh.net> References: <20231105-nolibc-mips-be-v1-0-6c2ad3e50a1f@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v1-0-6c2ad3e50a1f@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699179006; l=4241; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=eTORcR+pRc30ECZqg+vICxSGsI/8LMSk3yiX/z1LA/E=; b=aOvBzfE7WZmfuQkaIbTLrFfPLbwLTOQ2ywawG4XC68Cq0nnEUb906jWFs5J0hy3rstR3m+tv1 eetqz9ccsyzANvCRNx9S4vMhT72P3DJ+Nu0GaYZ+38YJrcPeIXwx8Hz X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MIPS has many different configurations prepare the support of additional ones by moving the build of MIPS to the generic XARCH infrastructure. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 12 +++++++----- tools/testing/selftests/nolibc/run-tests.sh | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selfte= sts/nolibc/Makefile index c5df1617cbc3..15c12f3c27ba 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -40,12 +40,14 @@ objtree ?=3D $(srctree) =20 # configure default variants for target kernel supported architectures XARCH_powerpc =3D ppc +XARCH_mips =3D mipso32le XARCH =3D $(or $(XARCH_$(ARCH)),$(ARCH)) =20 # map from user input variants to their kernel supported architectures ARCH_ppc =3D powerpc ARCH_ppc64 =3D powerpc ARCH_ppc64le =3D powerpc +ARCH_mipso32le =3D mips ARCH :=3D $(or $(ARCH_$(XARCH)),$(XARCH)) =20 # kernel image names by architecture @@ -54,7 +56,7 @@ IMAGE_x86_64 =3D arch/x86/boot/bzImage IMAGE_x86 =3D arch/x86/boot/bzImage IMAGE_arm64 =3D arch/arm64/boot/Image IMAGE_arm =3D arch/arm/boot/zImage -IMAGE_mips =3D vmlinuz +IMAGE_mipso32le =3D vmlinuz IMAGE_ppc =3D vmlinux IMAGE_ppc64 =3D vmlinux IMAGE_ppc64le =3D arch/powerpc/boot/zImage @@ -70,7 +72,7 @@ DEFCONFIG_x86_64 =3D defconfig DEFCONFIG_x86 =3D defconfig DEFCONFIG_arm64 =3D defconfig DEFCONFIG_arm =3D multi_v7_defconfig -DEFCONFIG_mips =3D malta_defconfig +DEFCONFIG_mipso32le =3D malta_defconfig DEFCONFIG_ppc =3D pmac32_defconfig DEFCONFIG_ppc64 =3D powernv_be_defconfig DEFCONFIG_ppc64le =3D powernv_defconfig @@ -88,7 +90,7 @@ QEMU_ARCH_x86_64 =3D x86_64 QEMU_ARCH_x86 =3D x86_64 QEMU_ARCH_arm64 =3D aarch64 QEMU_ARCH_arm =3D arm -QEMU_ARCH_mips =3D mipsel # works with malta_defconfig +QEMU_ARCH_mipso32le =3D mipsel # works with malta_defconfig QEMU_ARCH_ppc =3D ppc QEMU_ARCH_ppc64 =3D ppc64 QEMU_ARCH_ppc64le =3D ppc64 @@ -110,7 +112,7 @@ QEMU_ARGS_x86_64 =3D -M pc -append "console=3DttyS0= ,9600 i8042.noaux panic=3D-1 $( QEMU_ARGS_x86 =3D -M pc -append "console=3DttyS0,9600 i8042.noaux p= anic=3D-1 $(TEST:%=3DNOLIBC_TEST=3D%)" QEMU_ARGS_arm64 =3D -M virt -cpu cortex-a53 -append "panic=3D-1 $(TES= T:%=3DNOLIBC_TEST=3D%)" QEMU_ARGS_arm =3D -M virt -append "panic=3D-1 $(TEST:%=3DNOLIBC_TES= T=3D%)" -QEMU_ARGS_mips =3D -M malta -append "panic=3D-1 $(TEST:%=3DNOLIBC_TE= ST=3D%)" +QEMU_ARGS_mipso32le =3D -M malta -append "panic=3D-1 $(TEST:%=3DNOLIBC_TE= ST=3D%)" QEMU_ARGS_ppc =3D -M g3beige -append "console=3DttyS0 panic=3D-1 $(= TEST:%=3DNOLIBC_TEST=3D%)" QEMU_ARGS_ppc64 =3D -M powernv -append "console=3Dhvc0 panic=3D-1 $(T= EST:%=3DNOLIBC_TEST=3D%)" QEMU_ARGS_ppc64le =3D -M powernv -append "console=3Dhvc0 panic=3D-1 $(T= EST:%=3DNOLIBC_TEST=3D%)" @@ -134,7 +136,7 @@ CFLAGS_ppc =3D -m32 -mbig-endian -mno-vsx $(call cc-opt= ion,-mmultiple) CFLAGS_ppc64 =3D -m64 -mbig-endian -mno-vsx $(call cc-option,-mmultiple) CFLAGS_ppc64le =3D -m64 -mlittle-endian -mno-vsx $(call cc-option,-mabi=3D= elfv2) CFLAGS_s390 =3D -m64 -CFLAGS_mips =3D -EL +CFLAGS_mipso32le =3D -EL CFLAGS_STACKPROTECTOR ?=3D $(call cc-option,-mstack-protector-guard=3Dglob= al $(call cc-option,-fstack-protector-all)) CFLAGS ?=3D -Os -fno-ident -fno-asynchronous-unwind-tables -std=3Dc89 -W = -Wall -Wextra \ $(call cc-option,-fno-stack-protector) \ diff --git a/tools/testing/selftests/nolibc/run-tests.sh b/tools/testing/se= lftests/nolibc/run-tests.sh index 1bf020d49f54..fb825c05031a 100755 --- a/tools/testing/selftests/nolibc/run-tests.sh +++ b/tools/testing/selftests/nolibc/run-tests.sh @@ -14,7 +14,7 @@ cache_dir=3D"${XDG_CACHE_HOME:-"$HOME"/.cache}" download_location=3D"${cache_dir}/crosstools/" build_location=3D"$(realpath "${cache_dir}"/nolibc-tests/)" perform_download=3D0 -archs=3D"i386 x86_64 arm64 arm mips ppc ppc64 ppc64le riscv s390 loongarch" +archs=3D"i386 x86_64 arm64 arm mipso32le ppc ppc64 ppc64le riscv s390 loon= garch" =20 TEMP=3D$(getopt -o 'j:d:c:b:a:ph' -n "$0" -- "$@") =20 --=20 2.42.1 From nobody Wed Dec 31 10:36:14 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB48FC4332F for ; Sun, 5 Nov 2023 10:10:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230181AbjKEKKQ (ORCPT ); Sun, 5 Nov 2023 05:10:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbjKEKKM (ORCPT ); Sun, 5 Nov 2023 05:10:12 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFF34EE; Sun, 5 Nov 2023 02:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699179007; bh=Ub0vfkKTHQaxoKQLNxleKQsHEn6st8jde4Faibw+HU4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=PHXRxBuygJSjWJJPy7h88sXSdqvzAHV0/Omgiuaxiwb9ilxsJJdh0UlefMW5shctD 9/i7EYZbjIW6o6v8HxtAomLdvTWLh/yesIjADJX3L9+etj9wzm8+mtMWbfi6R7DRb+ Ld31aVjeiN+fVY9LEyL/D1RlQGzdpfgaPRnt98js= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 11:09:58 +0100 Subject: [PATCH 4/6] selftests/nolibc: explicitly specify ABI for MIPS MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20231105-nolibc-mips-be-v1-4-6c2ad3e50a1f@weissschuh.net> References: <20231105-nolibc-mips-be-v1-0-6c2ad3e50a1f@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v1-0-6c2ad3e50a1f@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699179006; l=1051; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=Ub0vfkKTHQaxoKQLNxleKQsHEn6st8jde4Faibw+HU4=; b=QtlZAmoS38Wuiigizvm3fQP1+w3wMJyzrNQM7bn8X94d7O9xEW7WEGR+5HV5fWwlwQzFmFAjQ nh8xTFIVY2RACsl+i+LPp9mFgMaslo3JGqKbP3aYMDUKrZXengTpbb3 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org More ABIs exist, for better clarity specify it explicitly everywhere. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selfte= sts/nolibc/Makefile index 15c12f3c27ba..f8fea9fa0263 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -136,7 +136,7 @@ CFLAGS_ppc =3D -m32 -mbig-endian -mno-vsx $(call cc-opt= ion,-mmultiple) CFLAGS_ppc64 =3D -m64 -mbig-endian -mno-vsx $(call cc-option,-mmultiple) CFLAGS_ppc64le =3D -m64 -mlittle-endian -mno-vsx $(call cc-option,-mabi=3D= elfv2) CFLAGS_s390 =3D -m64 -CFLAGS_mipso32le =3D -EL +CFLAGS_mipso32le =3D -EL -mabi=3D32 CFLAGS_STACKPROTECTOR ?=3D $(call cc-option,-mstack-protector-guard=3Dglob= al $(call cc-option,-fstack-protector-all)) CFLAGS ?=3D -Os -fno-ident -fno-asynchronous-unwind-tables -std=3Dc89 -W = -Wall -Wextra \ $(call cc-option,-fno-stack-protector) \ --=20 2.42.1 From nobody Wed Dec 31 10:36:14 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95903C4332F for ; Sun, 5 Nov 2023 10:10:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229884AbjKEKKY (ORCPT ); Sun, 5 Nov 2023 05:10:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230154AbjKEKKO (ORCPT ); Sun, 5 Nov 2023 05:10:14 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D42FEE1; Sun, 5 Nov 2023 02:10:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699179007; bh=RD5TMEI3DvwFGeIbn1MxJkvOuIwUyEIM6E3CWF7zhCs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=VtgoQbRnbg7D8L2jVsJ2VecXPhIGoIIKbYqEBqrMu291UT2sypuZRsKBJ0S5TcIEQ 0tKHPwnvYncCFiBdEZTT4zkbS6W6ML6EsfgkQ3Ab3Z7E2vFpi0j6TLI/FzAV5VFMDU Xz0faz8nAmtwBW7s4R9dkSoaSe7eJ6YIbILtC1kQ= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 11:09:59 +0100 Subject: [PATCH 5/6] selftests/nolibc: extraconfig support MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20231105-nolibc-mips-be-v1-5-6c2ad3e50a1f@weissschuh.net> References: <20231105-nolibc-mips-be-v1-0-6c2ad3e50a1f@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v1-0-6c2ad3e50a1f@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699179006; l=1246; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=RD5TMEI3DvwFGeIbn1MxJkvOuIwUyEIM6E3CWF7zhCs=; b=0Y1uz+HV+6jCTVNSi04qksfUleoSSIvQ4s7H43s39ob3QPfiK8IgTixMIgyc1j/WUqJz2uUpN FEclfzFdc/vCgoHSMJtfS1viqNFRmA3VaBf4Gc9/z8y631aS6EomftV X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow some postprocessing of defconfig files. Suggested-by: Zhangjin Wu Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selfte= sts/nolibc/Makefile index f8fea9fa0263..02c074e73a28 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -81,6 +81,8 @@ DEFCONFIG_s390 =3D defconfig DEFCONFIG_loongarch =3D defconfig DEFCONFIG =3D $(DEFCONFIG_$(XARCH)) =20 +EXTRACONFIG =3D $(EXTRACONFIG_$(XARCH)) + # optional tests to run (default =3D all) TEST =3D =20 @@ -227,6 +229,10 @@ initramfs: nolibc-test =20 defconfig: $(Q)$(MAKE) -C $(srctree) ARCH=3D$(ARCH) CC=3D$(CC) CROSS_COMPILE=3D$(CRO= SS_COMPILE) mrproper $(DEFCONFIG) prepare + $(Q)if [ -n "$(EXTRACONFIG)" ]; then \ + $(srctree)/scripts/config --file $(objtree)/.config $(EXTRACONFIG); \ + $(MAKE) -C $(srctree) ARCH=3D$(ARCH) CC=3D$(CC) CROSS_COMPILE=3D$(CROSS_= COMPILE) oldconfig < /dev/null; \ + fi =20 kernel: $(Q)$(MAKE) -C $(srctree) ARCH=3D$(ARCH) CC=3D$(CC) CROSS_COMPILE=3D$(CRO= SS_COMPILE) $(IMAGE_NAME) --=20 2.42.1 From nobody Wed Dec 31 10:36:14 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD6D7C4332F for ; Sun, 5 Nov 2023 10:10:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230335AbjKEKK2 (ORCPT ); Sun, 5 Nov 2023 05:10:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjKEKKO (ORCPT ); Sun, 5 Nov 2023 05:10:14 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11351E9; Sun, 5 Nov 2023 02:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699179007; bh=QJrkWdgI6pd5Nzom+uI7s0H64zVW61s2WGdjVOhleds=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Bxvsr1SZVKZ2jn8JpzY/4MS+dangbVT1VwRkMx6FSg4eLGZohnDVWKIzzzc1hcOJH UOGYBuiWCs/ipKUYRQl6DI6raCDubfXpvwMHxybv9mwSUMfsGgkYXhyco/SFXy6/PG G7g1nIvBnLEO2rvHurU8v4W0ZKfkMF12vnFzsmAA= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 11:10:00 +0100 Subject: [PATCH 6/6] selftests/nolibc: add configuration for mipso32be MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20231105-nolibc-mips-be-v1-6-6c2ad3e50a1f@weissschuh.net> References: <20231105-nolibc-mips-be-v1-0-6c2ad3e50a1f@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v1-0-6c2ad3e50a1f@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699179006; l=3895; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=QJrkWdgI6pd5Nzom+uI7s0H64zVW61s2WGdjVOhleds=; b=ItS8E7G1VosjhdiPN1Bjorlgt4ymAZJUqh6NsosQxdpnMI+REnwslVzzyLl3U0835fkGkHIR3 lqW9F1p0JwSAjlFje4cDNHzS+Sz/iq2FNlHvo3bBjbsipDw96NYvTr3 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow testing MIPS O32 big endian. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 7 +++++++ tools/testing/selftests/nolibc/run-tests.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selfte= sts/nolibc/Makefile index 02c074e73a28..316a8a1d09af 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -48,6 +48,7 @@ ARCH_ppc =3D powerpc ARCH_ppc64 =3D powerpc ARCH_ppc64le =3D powerpc ARCH_mipso32le =3D mips +ARCH_mipso32be =3D mips ARCH :=3D $(or $(ARCH_$(XARCH)),$(XARCH)) =20 # kernel image names by architecture @@ -57,6 +58,7 @@ IMAGE_x86 =3D arch/x86/boot/bzImage IMAGE_arm64 =3D arch/arm64/boot/Image IMAGE_arm =3D arch/arm/boot/zImage IMAGE_mipso32le =3D vmlinuz +IMAGE_mipso32be =3D vmlinuz IMAGE_ppc =3D vmlinux IMAGE_ppc64 =3D vmlinux IMAGE_ppc64le =3D arch/powerpc/boot/zImage @@ -73,6 +75,7 @@ DEFCONFIG_x86 =3D defconfig DEFCONFIG_arm64 =3D defconfig DEFCONFIG_arm =3D multi_v7_defconfig DEFCONFIG_mipso32le =3D malta_defconfig +DEFCONFIG_mipso32be =3D malta_defconfig DEFCONFIG_ppc =3D pmac32_defconfig DEFCONFIG_ppc64 =3D powernv_be_defconfig DEFCONFIG_ppc64le =3D powernv_defconfig @@ -81,6 +84,7 @@ DEFCONFIG_s390 =3D defconfig DEFCONFIG_loongarch =3D defconfig DEFCONFIG =3D $(DEFCONFIG_$(XARCH)) =20 +EXTRACONFIG_mipso32be =3D -d CONFIG_CPU_LITTLE_ENDIAN -e CONFIG_CPU_BIG_EN= DIAN EXTRACONFIG =3D $(EXTRACONFIG_$(XARCH)) =20 # optional tests to run (default =3D all) @@ -93,6 +97,7 @@ QEMU_ARCH_x86 =3D x86_64 QEMU_ARCH_arm64 =3D aarch64 QEMU_ARCH_arm =3D arm QEMU_ARCH_mipso32le =3D mipsel # works with malta_defconfig +QEMU_ARCH_mipso32be =3D mips QEMU_ARCH_ppc =3D ppc QEMU_ARCH_ppc64 =3D ppc64 QEMU_ARCH_ppc64le =3D ppc64 @@ -115,6 +120,7 @@ QEMU_ARGS_x86 =3D -M pc -append "console=3DttyS0= ,9600 i8042.noaux panic=3D-1 $( QEMU_ARGS_arm64 =3D -M virt -cpu cortex-a53 -append "panic=3D-1 $(TES= T:%=3DNOLIBC_TEST=3D%)" QEMU_ARGS_arm =3D -M virt -append "panic=3D-1 $(TEST:%=3DNOLIBC_TES= T=3D%)" QEMU_ARGS_mipso32le =3D -M malta -append "panic=3D-1 $(TEST:%=3DNOLIBC_TE= ST=3D%)" +QEMU_ARGS_mipso32be =3D -M malta -append "panic=3D-1 $(TEST:%=3DNOLIBC_TE= ST=3D%)" QEMU_ARGS_ppc =3D -M g3beige -append "console=3DttyS0 panic=3D-1 $(= TEST:%=3DNOLIBC_TEST=3D%)" QEMU_ARGS_ppc64 =3D -M powernv -append "console=3Dhvc0 panic=3D-1 $(T= EST:%=3DNOLIBC_TEST=3D%)" QEMU_ARGS_ppc64le =3D -M powernv -append "console=3Dhvc0 panic=3D-1 $(T= EST:%=3DNOLIBC_TEST=3D%)" @@ -139,6 +145,7 @@ CFLAGS_ppc64 =3D -m64 -mbig-endian -mno-vsx $(call cc-o= ption,-mmultiple) CFLAGS_ppc64le =3D -m64 -mlittle-endian -mno-vsx $(call cc-option,-mabi=3D= elfv2) CFLAGS_s390 =3D -m64 CFLAGS_mipso32le =3D -EL -mabi=3D32 +CFLAGS_mipso32be =3D -EB -mabi=3D32 CFLAGS_STACKPROTECTOR ?=3D $(call cc-option,-mstack-protector-guard=3Dglob= al $(call cc-option,-fstack-protector-all)) CFLAGS ?=3D -Os -fno-ident -fno-asynchronous-unwind-tables -std=3Dc89 -W = -Wall -Wextra \ $(call cc-option,-fno-stack-protector) \ diff --git a/tools/testing/selftests/nolibc/run-tests.sh b/tools/testing/se= lftests/nolibc/run-tests.sh index fb825c05031a..d6d3721b5d84 100755 --- a/tools/testing/selftests/nolibc/run-tests.sh +++ b/tools/testing/selftests/nolibc/run-tests.sh @@ -14,7 +14,7 @@ cache_dir=3D"${XDG_CACHE_HOME:-"$HOME"/.cache}" download_location=3D"${cache_dir}/crosstools/" build_location=3D"$(realpath "${cache_dir}"/nolibc-tests/)" perform_download=3D0 -archs=3D"i386 x86_64 arm64 arm mipso32le ppc ppc64 ppc64le riscv s390 loon= garch" +archs=3D"i386 x86_64 arm64 arm mipso32le mipso32be ppc ppc64 ppc64le riscv= s390 loongarch" =20 TEMP=3D$(getopt -o 'j:d:c:b:a:ph' -n "$0" -- "$@") =20 --=20 2.42.1