Properly build multilib bare-metal RISC-V

To build multilib RISC-V toolchain one should use --with-multilib-generator
option instead of --with-multilib-list.

Add corresponding example configuration file.

Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
This commit is contained in:
Kirill K. Smirnov 2023-07-09 23:06:17 +03:00 committed by Chris Packham
parent 11d286dbc9
commit ada71ff2a0
4 changed files with 32 additions and 0 deletions

View File

@ -81,6 +81,7 @@ config CC_GCC_EXTRA_CONFIG_ARRAY
config CC_GCC_MULTILIB_LIST
string "List of multilib variants"
depends on MULTILIB
depends on ! (ARCH_RISCV && BARE_METAL)
default "m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single" if GCC_11_or_later && ARCH_SH
default "aprofile,rmprofile" if ARCH_ARM && ARCH_32
help
@ -89,6 +90,18 @@ config CC_GCC_MULTILIB_LIST
for the format of this option for a particular architecture.
Leave empty to use the default list for this architecture.
config CC_GCC_MULTILIB_GENERATOR
string "Generator of RISC-V multilib variants"
depends on MULTILIB
depends on (ARCH_RISCV && BARE_METAL)
default ""
help
Multilib generator for RISC-V architecture.
For more information please refer to gcc manual
If unsure, leave empty.
config STATIC_TOOLCHAIN
bool
select CC_GCC_STATIC_LIBSTDCXX

View File

@ -0,0 +1,10 @@
CT_CONFIG_VERSION="4"
CT_EXPERIMENTAL=y
CT_ARCH_RISCV=y
CT_MULTILIB=y
CT_ARCH_USE_MMU=y
CT_ARCH_64=y
CT_ARCH_ARCH="rv64gc"
CT_TARGET_VENDOR="multilib"
CT_CC_GCC_MULTILIB_GENERATOR="rv32e-ilp32e--;rv32ea-ilp32e--;rv32em-ilp32e--;rv32eac-ilp32e--;rv32emac-ilp32e--;rv32i-ilp32--;rv32ia-ilp32--;rv32im-ilp32--;rv32if-ilp32f--;rv32ifd-ilp32d--;rv32iaf-ilp32f--;rv32iafd-ilp32d--;rv32imf-ilp32f--;rv32imfd-ilp32d--;rv32iac-ilp32--;rv32imac-ilp32--;rv32imafc-ilp32f--;rv32imafdc-ilp32d--;rv64i-lp64--;rv64ia-lp64--;rv64im-lp64--;rv64if-lp64f--;rv64ifd-lp64d--;rv64iaf-lp64f--;rv64iafd-lp64d--;rv64imf-lp64f--;rv64imaf-lp64f--;rv64iac-lp64--;rv64imac-lp64--;rv64imafc-lp64f--;rv64imafdc-lp64d--"
CT_CC_LANG_CXX=y

View File

@ -0,0 +1,3 @@
reporter_name="Kirill K. Smirnov"
reporter_url=""
reporter_comment="Example of multilib bare-metal RISC-V"

View File

@ -541,6 +541,9 @@ do_gcc_core_backend() {
if [ -n "${CT_CC_GCC_MULTILIB_LIST}" ]; then
extra_config+=("--with-multilib-list=${CT_CC_GCC_MULTILIB_LIST}")
fi
if [ -n "${CT_CC_GCC_MULTILIB_GENERATOR}" ]; then
extra_config+=("--with-multilib-generator=${CT_CC_GCC_MULTILIB_GENERATOR}")
fi
fi
CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
@ -1202,6 +1205,9 @@ do_gcc_backend() {
if [ -n "${CT_CC_GCC_MULTILIB_LIST}" ]; then
extra_config+=("--with-multilib-list=${CT_CC_GCC_MULTILIB_LIST}")
fi
if [ -n "${CT_CC_GCC_MULTILIB_GENERATOR}" ]; then
extra_config+=("--with-multilib-generator=${CT_CC_GCC_MULTILIB_GENERATOR}")
fi
fi
CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"