diff options
author | Kito Cheng <kito.cheng@sifive.com> | 2020-06-19 00:36:23 -0700 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2020-11-02 17:00:51 +0800 |
commit | c1e6691245ca2f1f329549f323f67afe32bcb97a (patch) | |
tree | 5c73db096ab8cbb7c31931592b72f253e2449a23 /gcc/config.gcc | |
parent | c3c3e2c9e88e25a410a2fe089782b094e911bb39 (diff) | |
download | gcc-c1e6691245ca2f1f329549f323f67afe32bcb97a.zip gcc-c1e6691245ca2f1f329549f323f67afe32bcb97a.tar.gz gcc-c1e6691245ca2f1f329549f323f67afe32bcb97a.tar.bz2 |
RISC-V: Add configure option: --with-multilib-generator to flexible config multi-lib settings.
- Able to configure complex multi-lib rule in configure time, without modify
any in-tree source.
- I was consider to implmenet this into `--with-multilib-list` option,
but I am not sure who will using that with riscv*-*-elf*, so I decide to
using another option name for that.
- --with-multilib-generator will pass arguments to multilib-generator, and
then using the generated multi-lib config file to build the toolchain.
e.g. Build riscv gcc, default arch/abi is rv64gc/lp64, and build multilib
for rv32imafd/ilp32 and rv32i/ilp32; rv32ic/ilp32 will reuse
rv32i/ilp32.
$ <GCC-SRC>/configure \
--target=riscv64-elf \
--with-arch=rv64gc --with-abi=lp64 \
--with-multilib-generator=rv32i-ilp32--c;rv32imafd-ilp32--
V3 Changes:
- Rename --with-multilib-config to --with-multilib-generator
- Check --with-multilib-generator and --with-multilib-list can't be used at
same time.
V2 Changes:
- Fix --with-multilib-config hanling on non riscv*-*-elf* triple.
gcc/ChangeLog:
* config.gcc (riscv*-*-*): Handle --with-multilib-generator.
* configure: Regen.
* configure.ac: Add --with-multilib-generator.
* config/riscv/multilib-generator: Exit when parsing arch string error.
* config/riscv/t-withmultilib-generator: New.
* doc/install.texi: Document --with-multilib-generator.
Diffstat (limited to 'gcc/config.gcc')
-rw-r--r-- | gcc/config.gcc | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc index b169f2f..dc6d68b 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -2438,11 +2438,13 @@ riscv*-*-elf* | riscv*-*-rtems*) tmake_file="${tmake_file} riscv/t-rtems" ;; *) - case "x${enable_multilib}" in - xno) ;; - xyes) tmake_file="${tmake_file} riscv/t-elf-multilib" ;; - *) echo "Unknown value for enable_multilib"; exit 1 - esac + if test "x${with_multilib_generator}" == xdefault; then + case "x${enable_multilib}" in + xno) ;; + xyes) tmake_file="${tmake_file} riscv/t-elf-multilib" ;; + *) echo "Unknown value for enable_multilib"; exit 1 + esac + fi esac tmake_file="${tmake_file} riscv/t-riscv" gnu_ld=yes @@ -4609,6 +4611,30 @@ case "${target}" in exit 1 ;; esac + # Handle --with-multilib-generator. + if test "x${with_multilib_generator}" != xdefault; then + if test "x${with_multilib_list}" != xdefault; then + echo "--with-multilib-list= can't used with --with-multilib-generator= at same time" 1>&2 + exit 1 + fi + case "${target}" in + riscv*-*-elf*) + if ${srcdir}/config/riscv/multilib-generator \ + `echo ${with_multilib_generator} | sed 's/;/ /g'`\ + > t-multilib-config; + then + tmake_file="${tmake_file} riscv/t-withmultilib-generator" + else + echo "invalid option for --with-multilib-generator" 1>&2 + exit 1 + fi + ;; + *) + echo "--with-multilib-generator= is not supported for ${target}, only supported for riscv*-*-elf*" 1>&2 + exit 1 + ;; + esac + fi # Handle --with-multilib-list. if test "x${with_multilib_list}" != xdefault; then |