aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2021-12-04 00:34:09 +0100
committerSören Tempel <soeren+git@soeren-tempel.net>2021-12-05 10:23:38 +0100
commitd07d6c6ec49e4f69004d9e5a1e87e25b4310ab74 (patch)
tree8297de5664ee883e0362e7608e6679aac2f82b12
parent5009416a94026dee62c5db8a5419e2213be53d5a (diff)
downloadaports-d07d6c6ec49e4f69004d9e5a1e87e25b4310ab74.tar.gz
aports-d07d6c6ec49e4f69004d9e5a1e87e25b4310ab74.tar.bz2
aports-d07d6c6ec49e4f69004d9e5a1e87e25b4310ab74.tar.xz
community/gcc-cross-embedded: enable support for additional RISC-V ext.
-rw-r--r--community/gcc-cross-embedded/APKBUILD6
-rw-r--r--community/gcc-cross-embedded/riscv-extensions.patch168
2 files changed, 172 insertions, 2 deletions
diff --git a/community/gcc-cross-embedded/APKBUILD b/community/gcc-cross-embedded/APKBUILD
index 65199c9d96..50dc598ae8 100644
--- a/community/gcc-cross-embedded/APKBUILD
+++ b/community/gcc-cross-embedded/APKBUILD
@@ -20,7 +20,7 @@ case "$CARCH" in
esac
pkgname=gcc-cross-embedded
pkgver=11.2.0
-pkgrel=0
+pkgrel=1
pkgdesc="The GNU Compiler Collection for embedded targets"
url="https://gcc.gnu.org/"
depends="gcc"
@@ -34,7 +34,8 @@ for target in $_targets; do
makedepends="$makedepends binutils-$target newlib-$target-stage1"
done
-source="https://mirrors.kernel.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz"
+source="https://mirrors.kernel.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz
+ riscv-extensions.patch"
options="!check"
@@ -188,4 +189,5 @@ aarch64_none_elf() {
sha512sums="
d53a0a966230895c54f01aea38696f818817b505f1e2bfa65e508753fcd01b2aedb4a61434f41f3a2ddbbd9f41384b96153c684ded3f0fa97c82758d9de5c7cf gcc-11.2.0.tar.xz
+62dc3480140c3d255176a8121ba0086da5a1ab7024c84182c6edf41de176603a8ed0c9164ff2de55829f06efa7b8b1e12a42207d10b453a8582a1e8b5c6e247f riscv-extensions.patch
"
diff --git a/community/gcc-cross-embedded/riscv-extensions.patch b/community/gcc-cross-embedded/riscv-extensions.patch
new file mode 100644
index 0000000000..c9e4a4a483
--- /dev/null
+++ b/community/gcc-cross-embedded/riscv-extensions.patch
@@ -0,0 +1,168 @@
+By default, GCC will only builds the following multilibs for RISC-V:
+
+ rv32i/ilp32;@march=rv32i@mabi=ilp32
+ rv32im/ilp32;@march=rv32im@mabi=ilp32
+ rv32iac/ilp32;@march=rv32iac@mabi=ilp32
+ rv32imac/ilp32;@march=rv32imac@mabi=ilp32
+ rv32imafc/ilp32f;@march=rv32imafc@mabi=ilp32f
+ rv64imac/lp64;@march=rv64imac@mabi=lp64
+ rv64imafdc/lp64d;@march=rv64imafdc@mabi=lp64d
+
+This patch enables quite a few additional multilibs for a variety of
+different RISC-V extensions. The enabled multilibs have been taken from
+Debian [1]. Instead of patching the default RISC-V configuration file,
+it would also be possible to use the --with-multilib-generator=
+configure option instead.
+
+[1]: https://salsa.debian.org/debian/gcc-riscv64-unknown-elf/-/blob/4a1de76060cb8721c06bcfb4c846bc82ee6b3fc3/debian/patches/0002-Add-more-multi-lib-for-rv32-and-rv64.patch
+
+diff -upr gcc-11.2.0.orig/gcc/config/riscv/t-elf-multilib gcc-11.2.0/gcc/config/riscv/t-elf-multilib
+--- gcc-11.2.0.orig/gcc/config/riscv/t-elf-multilib 2021-12-04 15:09:53.633432461 +0100
++++ gcc-11.2.0/gcc/config/riscv/t-elf-multilib 2021-12-04 15:11:00.750169088 +0100
+@@ -1,30 +1,136 @@
+ # 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_DIRNAMES = rv32i \
++# ./gcc/config/riscv/multilib-generator rv32e-ilp32e--c rv32ea-ilp32e--m rv32em-ilp32e--c rv32eac-ilp32e-- rv32emac-ilp32e-- rv32i-ilp32--c rv32ia-ilp32--m rv32im-ilp32--c rv32if-ilp32f-rv32ifd-c rv32iaf-ilp32f-rv32imaf,rv32iafc-d rv32imf-ilp32f-rv32imfd-c rv32iac-ilp32-- rv32imac-ilp32-- rv32imafc-ilp32f-rv32imafdc- rv32ifd-ilp32d--c rv32imfd-ilp32d--c rv32iafd-ilp32d-rv32imafd,rv32iafdc- rv32imafdc-ilp32d-- rv64i-lp64--c rv64ia-lp64--m rv64im-lp64--c rv64if-lp64f-rv64ifd-c rv64iaf-lp64f-rv64imaf,rv64iafc-d rv64imf-lp64f-rv64imfd-c rv64iac-lp64-- rv64imac-lp64-- rv64imafc-lp64f-rv64imafdc- rv64ifd-lp64d--m,c rv64iafd-lp64d-rv64imafd,rv64iafdc- rv64imafdc-lp64d--
++MULTILIB_OPTIONS = march=rv32e/march=rv32ec/march=rv32ea/march=rv32ema/march=rv32em/march=rv32emc/march=rv32eac/march=rv32emac/march=rv32i/march=rv32ic/march=rv32ia/march=rv32ima/march=rv32im/march=rv32imc/march=rv32if/march=rv32ifc/march=rv32ifd/march=rv32ifdc/march=rv32iaf/march=rv32iafc/march=rv32iafd/march=rv32iafdc/march=rv32imaf/march=rv32imafd/march=rv32imf/march=rv32imfc/march=rv32imfd/march=rv32imfdc/march=rv32iac/march=rv32imac/march=rv32imafc/march=rv32imafdc/march=rv64i/march=rv64ic/march=rv64ia/march=rv64ima/march=rv64im/march=rv64imc/march=rv64if/march=rv64ifc/march=rv64ifd/march=rv64ifdc/march=rv64iaf/march=rv64iafc/march=rv64iafd/march=rv64iafdc/march=rv64imaf/march=rv64imafd/march=rv64imf/march=rv64imfc/march=rv64imfd/march=rv64imfdc/march=rv64iac/march=rv64imac/march=rv64imafc/march=rv64imafdc mabi=ilp32e/mabi=ilp32/mabi=ilp32f/mabi=ilp32d/mabi=lp64/mabi=lp64f/mabi=lp64d
++MULTILIB_DIRNAMES = rv32e \
++rv32ec \
++rv32ea \
++rv32ema \
++rv32em \
++rv32emc \
++rv32eac \
++rv32emac \
++rv32i \
+ rv32ic \
++rv32ia \
++rv32ima \
+ rv32im \
+ rv32imc \
++rv32if \
++rv32ifc \
++rv32ifd \
++rv32ifdc \
++rv32iaf \
++rv32iafc \
++rv32iafd \
++rv32iafdc \
++rv32imaf \
++rv32imafd \
++rv32imf \
++rv32imfc \
++rv32imfd \
++rv32imfdc \
+ rv32iac \
+ rv32imac \
+ rv32imafc \
+ rv32imafdc \
+-rv32gc \
++rv64i \
++rv64ic \
++rv64ia \
++rv64ima \
++rv64im \
++rv64imc \
++rv64if \
++rv64ifc \
++rv64ifd \
++rv64ifdc \
++rv64iaf \
++rv64iafc \
++rv64iafd \
++rv64iafdc \
++rv64imaf \
++rv64imafd \
++rv64imf \
++rv64imfc \
++rv64imfd \
++rv64imfdc \
++rv64iac \
+ rv64imac \
+-rv64imafdc \
+-rv64gc ilp32 \
++rv64imafc \
++rv64imafdc ilp32e \
++ilp32 \
+ ilp32f \
++ilp32d \
+ lp64 \
++lp64f \
+ lp64d
+-MULTILIB_REQUIRED = march=rv32i/mabi=ilp32 \
++MULTILIB_REQUIRED = march=rv32e/mabi=ilp32e \
++march=rv32ea/mabi=ilp32e \
++march=rv32em/mabi=ilp32e \
++march=rv32eac/mabi=ilp32e \
++march=rv32emac/mabi=ilp32e \
++march=rv32i/mabi=ilp32 \
++march=rv32ia/mabi=ilp32 \
+ march=rv32im/mabi=ilp32 \
++march=rv32if/mabi=ilp32f \
++march=rv32iaf/mabi=ilp32f \
++march=rv32imf/mabi=ilp32f \
+ march=rv32iac/mabi=ilp32 \
+ march=rv32imac/mabi=ilp32 \
+ march=rv32imafc/mabi=ilp32f \
++march=rv32ifd/mabi=ilp32d \
++march=rv32imfd/mabi=ilp32d \
++march=rv32iafd/mabi=ilp32d \
++march=rv32imafdc/mabi=ilp32d \
++march=rv64i/mabi=lp64 \
++march=rv64ia/mabi=lp64 \
++march=rv64im/mabi=lp64 \
++march=rv64if/mabi=lp64f \
++march=rv64iaf/mabi=lp64f \
++march=rv64imf/mabi=lp64f \
++march=rv64iac/mabi=lp64 \
+ march=rv64imac/mabi=lp64 \
++march=rv64imafc/mabi=lp64f \
++march=rv64ifd/mabi=lp64d \
++march=rv64iafd/mabi=lp64d \
+ march=rv64imafdc/mabi=lp64d
+-MULTILIB_REUSE = march.rv32i/mabi.ilp32=march.rv32ic/mabi.ilp32 \
++MULTILIB_REUSE = march.rv32e/mabi.ilp32e=march.rv32ec/mabi.ilp32e \
++march.rv32ea/mabi.ilp32e=march.rv32ema/mabi.ilp32e \
++march.rv32em/mabi.ilp32e=march.rv32emc/mabi.ilp32e \
++march.rv32i/mabi.ilp32=march.rv32ic/mabi.ilp32 \
++march.rv32ia/mabi.ilp32=march.rv32ima/mabi.ilp32 \
+ march.rv32im/mabi.ilp32=march.rv32imc/mabi.ilp32 \
++march.rv32if/mabi.ilp32f=march.rv32ifc/mabi.ilp32f \
++march.rv32if/mabi.ilp32f=march.rv32ifd/mabi.ilp32f \
++march.rv32if/mabi.ilp32f=march.rv32ifdc/mabi.ilp32f \
++march.rv32iaf/mabi.ilp32f=march.rv32iafc/mabi.ilp32f \
++march.rv32iaf/mabi.ilp32f=march.rv32iafd/mabi.ilp32f \
++march.rv32iaf/mabi.ilp32f=march.rv32iafdc/mabi.ilp32f \
++march.rv32iaf/mabi.ilp32f=march.rv32imaf/mabi.ilp32f \
++march.rv32iaf/mabi.ilp32f=march.rv32imafd/mabi.ilp32f \
++march.rv32imf/mabi.ilp32f=march.rv32imfc/mabi.ilp32f \
++march.rv32imf/mabi.ilp32f=march.rv32imfd/mabi.ilp32f \
++march.rv32imf/mabi.ilp32f=march.rv32imfdc/mabi.ilp32f \
+ march.rv32imafc/mabi.ilp32f=march.rv32imafdc/mabi.ilp32f \
+-march.rv32imafc/mabi.ilp32f=march.rv32gc/mabi.ilp32f \
+-march.rv64imafdc/mabi.lp64d=march.rv64gc/mabi.lp64d
++march.rv32ifd/mabi.ilp32d=march.rv32ifdc/mabi.ilp32d \
++march.rv32imfd/mabi.ilp32d=march.rv32imfdc/mabi.ilp32d \
++march.rv32iafd/mabi.ilp32d=march.rv32iafdc/mabi.ilp32d \
++march.rv32iafd/mabi.ilp32d=march.rv32imafd/mabi.ilp32d \
++march.rv64i/mabi.lp64=march.rv64ic/mabi.lp64 \
++march.rv64ia/mabi.lp64=march.rv64ima/mabi.lp64 \
++march.rv64im/mabi.lp64=march.rv64imc/mabi.lp64 \
++march.rv64if/mabi.lp64f=march.rv64ifc/mabi.lp64f \
++march.rv64if/mabi.lp64f=march.rv64ifd/mabi.lp64f \
++march.rv64if/mabi.lp64f=march.rv64ifdc/mabi.lp64f \
++march.rv64iaf/mabi.lp64f=march.rv64iafc/mabi.lp64f \
++march.rv64iaf/mabi.lp64f=march.rv64iafd/mabi.lp64f \
++march.rv64iaf/mabi.lp64f=march.rv64iafdc/mabi.lp64f \
++march.rv64iaf/mabi.lp64f=march.rv64imaf/mabi.lp64f \
++march.rv64iaf/mabi.lp64f=march.rv64imafd/mabi.lp64f \
++march.rv64imf/mabi.lp64f=march.rv64imfc/mabi.lp64f \
++march.rv64imf/mabi.lp64f=march.rv64imfd/mabi.lp64f \
++march.rv64imf/mabi.lp64f=march.rv64imfdc/mabi.lp64f \
++march.rv64imafc/mabi.lp64f=march.rv64imafdc/mabi.lp64f \
++march.rv64ifd/mabi.lp64d=march.rv64ifdc/mabi.lp64d \
++march.rv64ifd/mabi.lp64d=march.rv64imfd/mabi.lp64d \
++march.rv64iafd/mabi.lp64d=march.rv64iafdc/mabi.lp64d \
++march.rv64iafd/mabi.lp64d=march.rv64imafd/mabi.lp64d