Skip to content

Commit cb839e0

Browse files
committed
selftests/nolibc: add armthumb configuration
While nolibc does support ARM Thumb instructions, that support was not tested specifically. Add a new test configuration for it. Tested-by: Willy Tarreau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Thomas Weißschuh <[email protected]>
1 parent f8bedb3 commit cb839e0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tools/testing/selftests/nolibc/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ XARCH_riscv = riscv64
4747
XARCH = $(or $(XARCH_$(ARCH)),$(ARCH))
4848

4949
# map from user input variants to their kernel supported architectures
50+
ARCH_armthumb = arm
5051
ARCH_ppc = powerpc
5152
ARCH_ppc64 = powerpc
5253
ARCH_ppc64le = powerpc
@@ -63,6 +64,7 @@ IMAGE_x86_64 = arch/x86/boot/bzImage
6364
IMAGE_x86 = arch/x86/boot/bzImage
6465
IMAGE_arm64 = arch/arm64/boot/Image
6566
IMAGE_arm = arch/arm/boot/zImage
67+
IMAGE_armthumb = arch/arm/boot/zImage
6668
IMAGE_mips32le = vmlinuz
6769
IMAGE_mips32be = vmlinuz
6870
IMAGE_ppc = vmlinux
@@ -83,6 +85,7 @@ DEFCONFIG_x86_64 = defconfig
8385
DEFCONFIG_x86 = defconfig
8486
DEFCONFIG_arm64 = defconfig
8587
DEFCONFIG_arm = multi_v7_defconfig
88+
DEFCONFIG_armthumb = multi_v7_defconfig
8689
DEFCONFIG_mips32le = malta_defconfig
8790
DEFCONFIG_mips32be = malta_defconfig generic/eb.config
8891
DEFCONFIG_ppc = pmac32_defconfig
@@ -107,6 +110,7 @@ QEMU_ARCH_x86_64 = x86_64
107110
QEMU_ARCH_x86 = x86_64
108111
QEMU_ARCH_arm64 = aarch64
109112
QEMU_ARCH_arm = arm
113+
QEMU_ARCH_armthumb = arm
110114
QEMU_ARCH_mips32le = mipsel # works with malta_defconfig
111115
QEMU_ARCH_mips32be = mips
112116
QEMU_ARCH_ppc = ppc
@@ -136,6 +140,7 @@ QEMU_ARGS_x86_64 = -M pc -append "console=ttyS0,9600 i8042.noaux panic=-1 $(
136140
QEMU_ARGS_x86 = -M pc -append "console=ttyS0,9600 i8042.noaux panic=-1 $(TEST:%=NOLIBC_TEST=%)"
137141
QEMU_ARGS_arm64 = -M virt -cpu cortex-a53 -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)"
138142
QEMU_ARGS_arm = -M virt -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)"
143+
QEMU_ARGS_armthumb = -M virt -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)"
139144
QEMU_ARGS_mips32le = -M malta -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)"
140145
QEMU_ARGS_mips32be = -M malta -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)"
141146
QEMU_ARGS_ppc = -M g3beige -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
@@ -161,6 +166,7 @@ endif
161166

162167
CFLAGS_i386 = $(call cc-option,-m32)
163168
CFLAGS_arm = -marm
169+
CFLAGS_armthumb = -mthumb -march=armv6t2
164170
CFLAGS_ppc = -m32 -mbig-endian -mno-vsx $(call cc-option,-mmultiple)
165171
CFLAGS_ppc64 = -m64 -mbig-endian -mno-vsx $(call cc-option,-mmultiple)
166172
CFLAGS_ppc64le = -m64 -mlittle-endian -mno-vsx $(call cc-option,-mabi=elfv2)

tools/testing/selftests/nolibc/run-tests.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ werror=1
1919
llvm=
2020
all_archs=(
2121
i386 x86_64
22-
arm64 arm
22+
arm64 arm armthumb
2323
mips32le mips32be
2424
ppc ppc64 ppc64le
2525
riscv32 riscv64
@@ -103,6 +103,7 @@ fi
103103
crosstool_arch() {
104104
case "$1" in
105105
arm64) echo aarch64;;
106+
armthumb) echo arm;;
106107
ppc) echo powerpc;;
107108
ppc64) echo powerpc64;;
108109
ppc64le) echo powerpc64;;
@@ -116,7 +117,7 @@ crosstool_arch() {
116117

117118
crosstool_abi() {
118119
case "$1" in
119-
arm) echo linux-gnueabi;;
120+
arm | armthumb) echo linux-gnueabi;;
120121
*) echo linux;;
121122
esac
122123
}

0 commit comments

Comments
 (0)