[PATCH] Add support to build riscv32 toolchain

Hesham Almatary heshamelmatary at gmail.com
Mon May 29 13:42:01 UTC 2017


---
 rtems/config/4.12/rtems-riscv32.bset               | 32 +++++++++++
 rtems/config/tools/rtems-binutils-2.28-1.cfg       | 22 ++++++++
 .../rtems-gcc-7.1.0-newlib-2.5.0.20170323-1.cfg    | 65 ++++++++++++++++++++++
 3 files changed, 119 insertions(+)
 create mode 100644 rtems/config/4.12/rtems-riscv32.bset
 create mode 100644 rtems/config/tools/rtems-binutils-2.28-1.cfg
 create mode 100644 rtems/config/tools/rtems-gcc-7.1.0-newlib-2.5.0.20170323-1.cfg

diff --git a/rtems/config/4.12/rtems-riscv32.bset b/rtems/config/4.12/rtems-riscv32.bset
new file mode 100644
index 0000000..28ca3b0
--- /dev/null
+++ b/rtems/config/4.12/rtems-riscv32.bset
@@ -0,0 +1,32 @@
+#
+# Tools Set for RTEMS riscv32 4.12 Stable
+#
+
+%define release 1
+
+%define rtems_arch riscv32
+
+#
+# The RTEMS base defines.
+#
+%include rtems-base.bset
+
+#
+# Patches for gcc and newlib
+#
+%patch add gcc -p1 https://raw.githubusercontent.com/heshamelmatary/riscv-rtems-patches/master/gcc-rtems-riscv.patch
+%patch add newlib -p1 https://raw.githubusercontent.com/heshamelmatary/riscv-rtems-patches/master/0001-riscv-add-riscv-to-ieeefp.h.patch
+
+#
+# Extra flags to gcc to build for 32-bit target (soft-float)
+#
+%define gcc_configure_extra_options --with-arch=rv32imac --with-abi=ilp32 --disable-multilib
+
+#
+# Tools configuration.
+#
+4.12/rtems-autotools
+devel/expat-2.1.0-1
+tools/rtems-binutils-2.28-1
+tools/rtems-gcc-7.1.0-newlib-2.5.0.20170323-1.cfg
+tools/rtems-tools-4.12-1
diff --git a/rtems/config/tools/rtems-binutils-2.28-1.cfg b/rtems/config/tools/rtems-binutils-2.28-1.cfg
new file mode 100644
index 0000000..d2e099c
--- /dev/null
+++ b/rtems/config/tools/rtems-binutils-2.28-1.cfg
@@ -0,0 +1,22 @@
+#
+# Binutils 2.28.
+#
+
+%include %{_configdir}/checks.cfg
+%include %{_configdir}/base.cfg
+
+%define binutils_version 2.28
+
+%hash sha512 binutils-%{binutils_version}.tar.bz2 ede2e4e59a800260eea8c14eafbaee94e30abadafd5c419a3370f9f62213cf027d6400a1d4970b6958bd4d220e675dcd483a708107016e7abd5c99d7392ba8fd 
+
+#
+# Enable deterministic archives by default. This will be the default
+# there all tools using this binutils will create deterministic
+# archives.
+#
+%define with_deterministic_archives 1
+
+#
+# The binutils build instructions. We use 2.xx Release 1.
+#
+%include %{_configdir}/binutils-2-1.cfg
diff --git a/rtems/config/tools/rtems-gcc-7.1.0-newlib-2.5.0.20170323-1.cfg b/rtems/config/tools/rtems-gcc-7.1.0-newlib-2.5.0.20170323-1.cfg
new file mode 100644
index 0000000..915edd3
--- /dev/null
+++ b/rtems/config/tools/rtems-gcc-7.1.0-newlib-2.5.0.20170323-1.cfg
@@ -0,0 +1,65 @@
+%include %{_configdir}/checks.cfg
+%include %{_configdir}/base.cfg
+
+%define gcc_version    7.1.0
+%define newlib_version 2.5.0.20170323
+%define mpfr_version   3.1.5
+%define mpc_version    1.0.3
+%define gmp_version    4.3.2
+
+#
+# FreeBSD specific fix for MIPS
+#
+%if %{_build_os} == freebsd
+ %patch add gcc --rsb-file=freebsd-libgcc-sed-fix.patch -p0 https://gcc.gnu.org/bugzilla/attachment.cgi?id=41380
+ %hash  sha256 freebsd-libgcc-sed-fix.patch 8a11bd619c2e55466688e328da00b387d02395c1e8ff4a99225152387a1e60a4
+%endif
+
+%hash sha512 gcc-7.1.0.tar.bz2 b5d952be9a10f0e0926bb2868877d10544039d6d2f35ba0a08f51231dd622a007650764a03e173194701467547789ad7d2d9cbc10adcdf118d619cdedbd14aec
+%hash sha512 newlib-2.5.0.20170323.tar.gz 323992603f994e82d1b8117da39ce08f8a6584330606e2d053ccefc62fce5682ac47f983aa3bc526c85bcabbcfce85cf607b08f87c5435d00cec6727c006f6b7
+%hash sha512 mpfr-3.1.5.tar.bz2 ebf94f49e1f850db6304eec8bf3cbf592b9fb06b743e0a99a660edae3c086aa47cdd089ea958fd4631ff02a444ec034b5e45d7e9701704d74c2e2d49021e49a7 
+%hash sha512 mpc-1.0.3.tar.gz 0028b76df130720c1fad7de937a0d041224806ce5ef76589f19c7b49d956071a683e2f20d154c192a231e69756b19e48208f2889b0c13950ceb7b3cfaf059a43 
+%hash sha512 gmp-4.3.2.tar.bz2 2e0b0fd23e6f10742a5517981e5171c6e88b0a93c83da701b296f5c0861d72c19782daab589a7eac3f9032152a0fc7eff7f5362db8fccc4859564a9aa82329cf
+
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=f70d9ae6adc6ed7952806056349ba9f8ba3c65c8
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=086730fb14c1c4171764e605d7510e33f0fc34ed
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=e0dabc0e8dd6d9e2a21ceef124a1e4bf9f3d8aa3
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=84a6dba57ed351a275889a3e8c87f566e3b3e508
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=81c121c48739df247ade660659cd6672a9a2c7dd
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=e1563a05b714f42502496466f12df7b461f40dd1
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=7b07f11b1fc79224afaa8967a356796610bf82bf
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=3abc66ec6bf8c4312da413a62a5740a33edccaad
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=d3e919b42a26c14d47f668397519f455807dd613
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=a36e348a9f6d8ec690b827a3ea2e0ef9814579f7
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=d3f9311fff9e16241590f0bc10cf5466f04b40b7
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=73603c98aa6f52ebedc539289c30c03f3b8f7093
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=218c5e7d7264f1ed532d64d1932104fd8864b962
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=9998bd4b7c4596e47d8e0fbc6f1f370d096a6618
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=5e36b7010419bdd22116ac26c1b33a4b0831a047
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=6c6ea2e457373d59e48634363c409412c3c09ccd
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=7c4ae7770ea1537ba3bed956d328fb48fdef708f
+%patch add newlib -p1 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=eb14d0cc649978c10928bf38c1847f295bf0de69
+%hash sha512 newlib-cygwin-git-086730fb14c1c4171764e605d7510e33f0fc34ed.patch 40ec1c04932e8a11ed2e8ea6986d9a1ca3ac9d866b9ab7007ad4126a4abe8616ee5304742fd4a387433c455cede3a108b00909ba206be227570e6de0121c26c2
+%hash sha512 newlib-cygwin-git-218c5e7d7264f1ed532d64d1932104fd8864b962.patch 632c5a4e09d6e73451d5664444f4c84540dad53ca4e5446253fac141bc62f22ddc374a6f0bff9758fe15a651aba4f63f8494242e9103a0930f042d2206fb7188
+%hash sha512 newlib-cygwin-git-3abc66ec6bf8c4312da413a62a5740a33edccaad.patch 4b05c9522a077c56daddcbf83f1356d6125dd4461e0d2c9fcf8b9fe896fb805754de4e0aba35cf20d158f86b07cf92acf21e9f26ce082f3118889a25318b253e
+%hash sha512 newlib-cygwin-git-5e36b7010419bdd22116ac26c1b33a4b0831a047.patch 8783bc19bf018c7019cae01bac7340b93ef9e6c492aae363a1882de8a9f467d9ef268bd8d9d5304fbc2addeeb953975756499843721fb972f5f4182b239b1739
+%hash sha512 newlib-cygwin-git-6c6ea2e457373d59e48634363c409412c3c09ccd.patch 30b85f9b04bb62d614e372d108e2c61eb25cbb8034bd0fa9e1fa0efc6341f189d6bf46eee1496e4922e2c01c1044d30c31b5ee6e96af342d8f3f9ba5c30fdf78
+%hash sha512 newlib-cygwin-git-73603c98aa6f52ebedc539289c30c03f3b8f7093.patch 2d52911384c4c3a098eb59915ba555c414e1322e9846d7a1490ac8cb744cb50781ccb30e95a54bfb3194c4a5c63fe520c1a51d1aa4f41cec12902d830ee1cc89
+%hash sha512 newlib-cygwin-git-7b07f11b1fc79224afaa8967a356796610bf82bf.patch 5b0628ff32af4665df73178a60844b5c2afbe217abacf550b63494400e9a667e8ced1bfe023703eb16f993ad286e1b5cf5d47369cacfd914cc9d8a64c4b3f950
+%hash sha512 newlib-cygwin-git-7c4ae7770ea1537ba3bed956d328fb48fdef708f.patch b7a9115464f35e2352f9fbb05f1c748e2e59d279ea1fa0bf798645a7929856732308c18badf7f520faf460818b10e69761ba7ec79254b0931fb2c5a65f690c76
+%hash sha512 newlib-cygwin-git-81c121c48739df247ade660659cd6672a9a2c7dd.patch 61420cfe84a2cda56f210e25027812ee6daae20a95d06b6e73bb22d7f31c1659f1198acb787dd9d11a710603a59e5c24fcf7f0c75c1f7899b5ea825c40f3a28b
+%hash sha512 newlib-cygwin-git-84a6dba57ed351a275889a3e8c87f566e3b3e508.patch 9d1fad38b27d23dd36fc9f4bfe505bda73e573c50a5db6160485596f3bc470efc8fbdd491e70523421f4cb49e0d14f5f145071a1cc2cdca1ed4e24582322077a
+%hash sha512 newlib-cygwin-git-9998bd4b7c4596e47d8e0fbc6f1f370d096a6618.patch 554263929cc229b084c7efa2a0dd7ce0bb742f314377886204ef770a3ef611222035b278240e93833c637649ab8992112c1aa33e905e460566fc6a6d69e04b5a
+%hash sha512 newlib-cygwin-git-a36e348a9f6d8ec690b827a3ea2e0ef9814579f7.patch 20db3205eb5b5eee2a4c8c40fb0c56f579c7d14b51b4785ab48d638a5f6fa9ba3c455a7ce655f80baac66ac74848da7074fc74f63be6d372cffc45061fa31b6b
+%hash sha512 newlib-cygwin-git-d3e919b42a26c14d47f668397519f455807dd613.patch 0866f67fb3e231707bf49fa6451364f5a214aec8b4d1dc1a06b523da80db44552735122396b7ec113be5c6dcd3543db689593584fd4ff9560586c5fcac2d9da5
+%hash sha512 newlib-cygwin-git-d3f9311fff9e16241590f0bc10cf5466f04b40b7.patch 879db1d25f47ae152fa70b031da9cfcc45b7dec0f5c9a4491adbd494fd6e0d38d4a6f9ab93b06943a62512b17fd163ea19e20bfb865ceec953180fe5fd0ad627
+%hash sha512 newlib-cygwin-git-e0dabc0e8dd6d9e2a21ceef124a1e4bf9f3d8aa3.patch 01203a1e5241e4c983cca7a55a81233167f0c796a0e14cae17b7761878fab41c88fa6ebacc783eb90323a315223a51f691908ba51d732125841045811e668056
+%hash sha512 newlib-cygwin-git-e1563a05b714f42502496466f12df7b461f40dd1.patch d1429572928e1fac9043d1958e41f48ef1592d43f2cd6fd817e096952671b0ee4b0aba7848722dc83a52dd3b5454249c4929a46b38ab1c342b3af3003d7db554
+%hash sha512 newlib-cygwin-git-eb14d0cc649978c10928bf38c1847f295bf0de69.patch eac2005f778419a5917dd7cd9a42488d3d1251a72c970b70f110c75fe9b4a7388a36c55e3244df65454c62e7262f48998390b37968060f3d7419d66d8516f708
+%hash sha512 newlib-cygwin-git-f70d9ae6adc6ed7952806056349ba9f8ba3c65c8.patch 915d233ae124a8fd6552aa320eb2b9910bb1417d378bad3cc43ee6dcb1b649fb7ea964a056e0afcf71b115c692af6c2ee99472f05b34b0024dd761041fdeb0db
+
+%define with_threads 1
+%define with_plugin  0
+%define with_iconv   1
+
+%include %{_configdir}/gcc-6-1.cfg
-- 
2.7.4



More information about the devel mailing list