summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@coreboot.org>2023-07-14 10:52:22 +0200
committerPatrick Georgi <patrick@coreboot.org>2023-07-17 13:57:12 +0000
commite4d660b2dc290b119496bc1de0fe4dc10046d04b (patch)
tree4c3ef7c90af95fe78fc9f85b19d39739fbafdf0a
parent9922a8b36330c7ba0372e6f0915c3238d89cd594 (diff)
crossgcc: Enable rv32iafc-ilp32 configuration
rv32iafc-ilp32 is compatible with rv32iac-ilp32 for library implementation, so add a reuse rule allowing the default configuration to support rv32iafc. -IAFC is an unusual configuration (much less common than -IMAFC), but multilib reuse has essentially no cost: this change is useful to users of platforms that support hardware floating-point but cannot use hardware multiply/divide for any reason. To avoid generating a new set of libraries this is limited to the soft-float ABI. Tested by verifying that `gcc -march=rv32iafc -mabi=ilp32 --print-search-dirs` refers to the rv32iac/ilp32 library directory as expected, rather than just the root library directory as occurs when an unsupported target is selected (for instance, rv32id). Change-Id: Ie056ba6488a138fe0876eebf7cbc59477b3c3518 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Signed-off-by: Patrick Georgi <patrick@coreboot.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/76539 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
-rw-r--r--util/crossgcc/patches/gcc-11.4.0_rv32iafc.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/util/crossgcc/patches/gcc-11.4.0_rv32iafc.patch b/util/crossgcc/patches/gcc-11.4.0_rv32iafc.patch
new file mode 100644
index 0000000000..5b0d715c63
--- /dev/null
+++ b/util/crossgcc/patches/gcc-11.4.0_rv32iafc.patch
@@ -0,0 +1,55 @@
+From 88bc675eab98cea388daf40396686178ca5fcdb3 Mon Sep 17 00:00:00 2001
+From: Peter Marheine <pmarheine@chromium.org>
+Date: Mon, 15 Aug 2022 11:01:50 +1000
+Subject: [PATCH] riscv: elf-multilib: add rv32iafc to defaults
+
+rv32iafc-ilp32 is compatible with rv32iac-ilp32 for library
+implementation, so add a reuse rule allowing the default configuration
+to support rv32iafc.
+
+-IAFC is an unusual configuration (much less common than -IMAFC), but
+multilib reuse has essentially no cost: this change is useful to users
+of platforms that support hardware floating-point but cannot use
+hardware multiply/divide for any reason. To avoid generating a new set
+of libraries this is limited to the soft-float ABI.
+
+Tested by verifying that `gcc -march=rv32iafc -mabi=ilp32
+--print-search-dirs` refers to the rv32iac/ilp32 library directory as
+expected, rather than just the root library directory as occurs when an
+unsupported target is selected (for instance, rv32id).
+
+Signed-off-by: Peter Marheine <pmarheine@chromium.org>
+---
+ gcc/config/riscv/t-elf-multilib | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/config/riscv/t-elf-multilib b/gcc/config/riscv/t-elf-multilib
+index 19f9434616c..6e74b1811be 100644
+--- a/gcc/config/riscv/t-elf-multilib
++++ b/gcc/config/riscv/t-elf-multilib
+@@ -1,11 +1,12 @@
+ # This file was generated by multilib-generator with the command:
+-# ./multilib-generator rv32i-ilp32--c rv32im-ilp32--c rv32iac-ilp32-- rv32imac-ilp32-- rv32imafc-ilp32f-rv32imafdc- rv64imac-lp64-- rv64imafdc-lp64d--
+-MULTILIB_OPTIONS = march=rv32i/march=rv32ic/march=rv32im/march=rv32imc/march=rv32iac/march=rv32imac/march=rv32imafc/march=rv32imafdc/march=rv32gc/march=rv64imac/march=rv64imafdc/march=rv64gc mabi=ilp32/mabi=ilp32f/mabi=lp64/mabi=lp64d
++# ./multilib-generator rv32i-ilp32--c rv32im-ilp32--c rv32iac-ilp32--f rv32imac-ilp32-- rv32imafc-ilp32f-rv32imafdc- rv64imac-lp64-- rv64imafdc-lp64d--
++MULTILIB_OPTIONS = march=rv32i/march=rv32ic/march=rv32im/march=rv32imc/march=rv32iac/march=rv32iafc/march=rv32imac/march=rv32imafc/march=rv32imafdc/march=rv32gc/march=rv64imac/march=rv64imafdc/march=rv64gc mabi=ilp32/mabi=ilp32f/mabi=lp64/mabi=lp64d
+ MULTILIB_DIRNAMES = rv32i \
+ rv32ic \
+ rv32im \
+ rv32imc \
+ rv32iac \
++rv32iafc \
+ rv32imac \
+ rv32imafc \
+ rv32imafdc \
+@@ -25,6 +26,7 @@ march=rv64imac/mabi=lp64 \
+ march=rv64imafdc/mabi=lp64d
+ MULTILIB_REUSE = march.rv32i/mabi.ilp32=march.rv32ic/mabi.ilp32 \
+ march.rv32im/mabi.ilp32=march.rv32imc/mabi.ilp32 \
++march.rv32iac/mabi.ilp32=march.rv32iafc/mabi.ilp32 \
+ march.rv32imafc/mabi.ilp32f=march.rv32imafdc/mabi.ilp32f \
+ march.rv32imafc/mabi.ilp32f=march.rv32gc/mabi.ilp32f \
+ march.rv64imafdc/mabi.lp64d=march.rv64gc/mabi.lp64d
+--
+2.37.1.595.g718a3a8f04-goog
+