Skip to content

Commit ffb5968

Browse files
authored
Merge pull request #1293 from riscv-collab/extra-multi-lib-test
Add --with-extra-multilib-test option
2 parents 5437780 + 3b13360 commit ffb5968

File tree

4 files changed

+56
-3
lines changed

4 files changed

+56
-3
lines changed

Makefile.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ endif
6969
GLIBC_MULTILIB_NAMES := @glibc_multilib_names@
7070
GCC_CHECKING_FLAGS := @gcc_checking@
7171

72+
EXTRA_MULTILIB_TEST := @extra_multilib_test@
73+
7274
XLEN := $(shell echo $(WITH_ARCH) | tr A-Z a-z | sed 's/.*rv\([0-9]*\).*/\1/')
7375
ifneq ($(XLEN),32)
7476
XLEN := 64
@@ -91,12 +93,12 @@ GDB_NATIVE_FLAGS := $(GDB_NATIVE_FLAGS_EXTRA)
9193
GLIBC_TARGET_FLAGS := $(GLIBC_TARGET_FLAGS_EXTRA)
9294
GLIBC_CC_FOR_TARGET ?= $(LINUX_TUPLE)-gcc
9395
GLIBC_CXX_FOR_TARGET ?= $(LINUX_TUPLE)-g++
94-
GLIBC_TARGET_BOARDS ?= $(shell echo "$(GLIBC_MULTILIB_NAMES)" | sed 's!\([_a-z0-9]*\)-\([_a-z0-9]*\)!riscv-sim/-march=\1/-mabi=\2/@cmodel@!g')
96+
GLIBC_TARGET_BOARDS ?= $(shell echo "$(GLIBC_MULTILIB_NAMES) $(EXTRA_MULTILIB_TEST)" | sed 's!\([_a-z0-9]*\)-\([_a-z0-9]*\)!riscv-sim/-march=\1/-mabi=\2/@cmodel@!g')
9597

9698
NEWLIB_CC_FOR_TARGET ?= $(NEWLIB_TUPLE)-gcc
9799
NEWLIB_CXX_FOR_TARGET ?= $(NEWLIB_TUPLE)-g++
98-
NEWLIB_TARGET_BOARDS ?= $(shell echo "$(NEWLIB_MULTILIB_NAMES)" | sed 's!\([_a-z0-9]*\)-\([_a-z0-9]*\)!riscv-sim/-march=\1/-mabi=\2/@cmodel@!g')
99-
NEWLIB_NANO_TARGET_BOARDS ?= $(shell echo "$(NEWLIB_MULTILIB_NAMES)" | sed 's!\([_a-z0-9]*\)-\([_a-z0-9]*\)!riscv-sim-nano/-march=\1/-mabi=\2/@cmodel@!g')
100+
NEWLIB_TARGET_BOARDS ?= $(shell echo "$(NEWLIB_MULTILIB_NAMES) $(EXTRA_MULTILIB_TEST)" | sed 's!\([_a-z0-9]*\)-\([_a-z0-9]*\)!riscv-sim/-march=\1/-mabi=\2/@cmodel@!g')
101+
NEWLIB_NANO_TARGET_BOARDS ?= $(shell echo "$(NEWLIB_MULTILIB_NAMES) $(EXTRA_MULTILIB_TEST)" | sed 's!\([_a-z0-9]*\)-\([_a-z0-9]*\)!riscv-sim-nano/-march=\1/-mabi=\2/@cmodel@!g')
100102
NEWLIB_CC_FOR_MULTILIB_INFO := $(NEWLIB_CC_FOR_TARGET)
101103

102104
MUSL_TARGET_FLAGS := $(MUSL_TARGET_FLAGS_EXTRA)

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,21 @@ The command below can be used to run the glibc tests:
246246

247247
make check-glibc-linux
248248

249+
##### Adding more arch/abi combination for testing without introducing multilib
250+
251+
`--with-extra-multilib-test` can be used when you want to test more combination
252+
of arch/ABI, for example: built a linux toolchain with multilib with
253+
`rv64gc/lp64d` and `rv64imac/lp64`, but you want to test more configuration like
254+
`rv64gcv/lp64d` or `rv64gcv_zba/lp64d`, then you can use --with-extra-multilib-test
255+
to specify that via `--with-extra-multilib-test="rv64gcv-lp64d;rv64gcv_zba-lp64d"`,
256+
then the testing will run for `rv64gc/lp64d`, `rv64imac/lp64`, `rv64gcv/lp64d`
257+
and `rv64gcv_zba/lp64d`.
258+
259+
`--with-extra-multilib-test` support bare-metal and linux toolchain and support
260+
even multilib is disable, but the user must ensure extra multilib test
261+
configuration can be work with existing lib/multilib, e.g. rv32gcv/ilp32 test
262+
can't work if multilib didn't have any rv32 multilib.
263+
249264
### LLVM / clang
250265

251266
LLVM can be used in combination with the RISC-V GNU Compiler Toolchain

configure

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ musl_multilib_names
611611
newlib_multilib_names
612612
glibc_multilib_names
613613
multilib_flags
614+
extra_multilib_test
614615
multilib_gen
615616
WITH_SIM
616617
WITH_ISA_SPEC
@@ -686,6 +687,7 @@ with_isa_spec
686687
with_sim
687688
enable_multilib
688689
with_multilib_generator
690+
with_extra_multilib_test
689691
enable_gcc_checking
690692
with_cmodel
691693
with_target_cflags
@@ -1355,6 +1357,13 @@ Optional Packages:
13551357
Multi-libs configuration string, only supported for
13561358
bare-metal/elf toolchain, this option implied
13571359
--enable-multilib
1360+
--with-extra-multilib-test
1361+
Adding extra multi-libs configuration for testing,
1362+
this can be use even --disable-multilib, but be
1363+
aware user need to make sure those extra multilib
1364+
set can work/compatible with existing multi-libs,
1365+
format: <arch>-<abi>;<arch>-<abi> e.g:
1366+
--with-extra-multilib-test="rv64gcv-lp64;rv64gcv_zba-lp64"
13581367
--with-cmodel Select the code model to use when building libc and
13591368
libgcc [--with-cmodel=medlow]
13601369
--with-target-cflags Add extra target flags for C for library code
@@ -3420,6 +3429,16 @@ else
34203429
fi
34213430
34223431
3432+
3433+
# Check whether --with-extra-multilib-test was given.
3434+
if test "${with_extra_multilib_test+set}" = set; then :
3435+
withval=$with_extra_multilib_test;
3436+
else
3437+
with_extra_multilib_test=no
3438+
3439+
fi
3440+
3441+
34233442
if test "x$with_multilib_generator" != xno; then :
34243443
multilib_gen="$with_multilib_generator"
34253444
@@ -3428,6 +3447,13 @@ else
34283447
34293448
fi
34303449
3450+
if test "x$with_extra_multilib_test" != xno; then :
3451+
extra_multilib_test="$with_extra_multilib_test"
3452+
3453+
else
3454+
extra_multilib_test=""
3455+
3456+
fi
34313457
34323458
if test "x$enable_multilib" != xno || test "x$with_multilib_generator" != xno; then :
34333459
multilib_flags=--enable-multilib

configure.ac

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,20 @@ AC_ARG_WITH(multilib-generator,
134134
[with_multilib_generator=no]
135135
)
136136

137+
AC_ARG_WITH(extra-multilib-test,
138+
[AS_HELP_STRING([--with-extra-multilib-test],
139+
[Adding extra multi-libs configuration for testing, this can be use even --disable-multilib, but be aware user need to make sure those extra multilib set can work/compatible with existing multi-libs, format: <arch>-<abi>;<arch>-<abi> e.g: --with-extra-multilib-test="rv64gcv-lp64;rv64gcv_zba-lp64"])],
140+
[],
141+
[with_extra_multilib_test=no]
142+
)
143+
137144
AS_IF([test "x$with_multilib_generator" != xno],
138145
[AC_SUBST(multilib_gen,"$with_multilib_generator")],
139146
[AC_SUBST(multilib_gen,"")])
140147

148+
AS_IF([test "x$with_extra_multilib_test" != xno],
149+
[AC_SUBST(extra_multilib_test,"$with_extra_multilib_test")],
150+
[AC_SUBST(extra_multilib_test,"")])
141151

142152
AS_IF([test "x$enable_multilib" != xno || test "x$with_multilib_generator" != xno],
143153
[AC_SUBST(multilib_flags,--enable-multilib)],

0 commit comments

Comments
 (0)