diff options
author | Kito Cheng <kito.cheng@sifive.com> | 2020-11-20 14:14:18 +0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2020-11-30 11:50:30 +0800 |
commit | a5ad5d5c478ee7bebf057161bb8715ee7d286875 (patch) | |
tree | 8b1d44a93f2b1867cf1d54de89581619c8d1c6b3 /gcc/config.gcc | |
parent | 3a5d8ed231a0329822b7c032ba0834991732d2a0 (diff) | |
download | gcc-a5ad5d5c478ee7bebf057161bb8715ee7d286875.zip gcc-a5ad5d5c478ee7bebf057161bb8715ee7d286875.tar.gz gcc-a5ad5d5c478ee7bebf057161bb8715ee7d286875.tar.bz2 |
RISC-V: Always define MULTILIB_DEFAULTS
- Define MULTILIB_DEFAULTS can reduce the total number of multilib if
the default arch and ABI are listed in the multilib config.
- This also simplify the implementation of --with-multilib-list.
gcc/ChangeLog:
* config.gcc (riscv*-*-*): Add TARGET_RISCV_DEFAULT_ABI and
TARGET_RISCV_DEFAULT_ARCH to tm_defines.
Remove including riscv/withmultilib.h for --with-multilib-list.
* config/riscv/riscv.h (STRINGIZING): New.
(__STRINGIZING): Ditto.
(MULTILIB_DEFAULTS): Ditto.
* config/riscv/withmultilib.h: Remove.
Diffstat (limited to 'gcc/config.gcc')
-rw-r--r-- | gcc/config.gcc | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc index aacab0d..6f1ee62 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -4612,6 +4612,8 @@ case "${target}" in exit 1 ;; esac + with_arch=`${srcdir}/config/riscv/arch-canonicalize ${with_arch}` + tm_defines="${tm_defines} TARGET_RISCV_DEFAULT_ARCH=${with_arch}" # Make sure --with-abi is valid. If it was not specified, # pick a default based on the ISA, preferring soft-float @@ -4633,6 +4635,7 @@ case "${target}" in exit 1 ;; esac + tm_defines="${tm_defines} TARGET_RISCV_DEFAULT_ABI=${with_abi}" # Make sure ABI and ISA are compatible. case "${with_abi},${with_arch}" in @@ -4675,7 +4678,6 @@ case "${target}" in # Handle --with-multilib-list. if test "x${with_multilib_list}" != xdefault; then - tm_file="${tm_file} riscv/withmultilib.h" tmake_file="${tmake_file} riscv/t-withmultilib" case ${with_multilib_list} in @@ -4687,42 +4689,6 @@ case "${target}" in echo "--with-multilib-list=${with_multilib_list} not supported." exit 1 esac - - # Define macros to select the default multilib. - case ${with_arch} in - rv32gc) - tm_defines="${tm_defines} TARGET_MLIB_ARCH=1" - ;; - rv64gc) - tm_defines="${tm_defines} TARGET_MLIB_ARCH=2" - ;; - *) - echo "unsupported --with-arch for --with-multilib-list" - exit 1 - esac - case ${with_abi} in - ilp32) - tm_defines="${tm_defines} TARGET_MLIB_ABI=1" - ;; - ilp32f) - tm_defines="${tm_defines} TARGET_MLIB_ABI=2" - ;; - ilp32d) - tm_defines="${tm_defines} TARGET_MLIB_ABI=3" - ;; - lp64) - tm_defines="${tm_defines} TARGET_MLIB_ABI=4" - ;; - lp64f) - tm_defines="${tm_defines} TARGET_MLIB_ABI=5" - ;; - lp64d) - tm_defines="${tm_defines} TARGET_MLIB_ABI=6" - ;; - *) - echo "unsupported --with-abi for --with-multilib" - exit 1 - esac fi ;; |