1 %global debug_package %{nil}
3 # Don't rm -rf $RPM_BUILD_ROOT at the top of install rule.
4 %global __spec_install_pre %{___build_pre}
6 # Strip breaks the libraries, don't do it.
7 %global __strip /bin/true
9 %global commit 1374381e01b30832581d65a56219388fe7d47584
10 %global shortcommit 1374381e
12 Name: riscv-gnu-toolchain
14 Release: 0.2.git%{shortcommit}%{?dist}
15 Summary: RISC-V GNU cross-toolchain, containing binutils and GCC
16 License: GPLv2+ and LGPLv2+ and BSD
18 URL: https://github.com/riscv/riscv-qemu
19 Source0: https://github.com/riscv/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
21 Source1: http://mirrors.kernel.org/gnu/binutils/binutils-2.26.tar.gz
22 Source2: http://mirrors.kernel.org/gnu/glibc/glibc-2.23.tar.gz
23 Source3: http://mirrors.kernel.org/gnu/gcc/gcc-6.1.0/gcc-6.1.0.tar.gz
24 Source4: ftp://sourceware.org/pub/newlib/newlib-2.2.0.tar.gz
26 # XXX These BuildRequires are just culled from the GCC spec
27 # and probably overestimate the real requirements.
28 BuildRequires: binutils
29 BuildRequires: glibc-static
30 BuildRequires: zlib-devel, gettext, bison, flex
31 BuildRequires: texinfo, texinfo-tex, /usr/bin/pod2man
32 BuildRequires: systemtap-sdt-devel
33 BuildRequires: gmp-devel, mpfr-devel, libmpc-devel
34 BuildRequires: hostname, procps
36 BuildRequires: glibc-devel
37 BuildRequires: elfutils-devel
38 BuildRequires: elfutils-libelf-devel
40 BuildRequires: glibc-devel
41 BuildRequires: libunwind
43 BuildRequires: isl-devel
44 BuildRequires: doxygen
45 BuildRequires: graphviz, texlive-collection-latex
49 This is the RISC-V fork of the GNU cross-compiler toolchain. It
50 includes binutils and GCC.
54 %setup -q -n %{name}-%{commit}
60 # The ordinary Makefile downloads upstream GNU packages. Instead we
61 # provide these as local files. Note this is "DISTDIR" not "DESTDIR".
62 export DISTDIR=%{_sourcedir}
64 # Since the Makefile installs as it goes along, set DESTDIR too, and
65 # clean the buildroot now (instead of at the top of install).
66 export DESTDIR=$RPM_BUILD_ROOT
67 rm -rf $RPM_BUILD_ROOT
68 mkdir -p $RPM_BUILD_ROOT
70 # We need to use the tools we built as we go along.
71 export PATH=$RPM_BUILD_ROOT%{_bindir}:$PATH
75 # The 'make linux' rule builds GCC linked against glibc (instead of
76 # newlib). However I couldn't make this work, and it's not really
82 # Not needed since the make installs as it goes along.
83 #make install DESTDIR=$RPM_BUILD_ROOT
85 # Remove some documentation, language files
86 rm -r $RPM_BUILD_ROOT%{_datadir}/info
87 rm -r $RPM_BUILD_ROOT%{_mandir}
88 rm -r $RPM_BUILD_ROOT%{_datadir}/locale
90 # Remove this libtool linker file.
91 rm $RPM_BUILD_ROOT%{_libdir}/libcc1.la
95 %doc README.md LICENSE
96 %{_bindir}/riscv64-unknown-elf-*
97 #%{_bindir}/riscv64-unknown-linux-gnu-*
99 %{_libdir}/libcc1.so.0
100 %{_libdir}/libcc1.so.0.0.0
101 %{_libexecdir}/gcc/riscv64-unknown-elf
102 #%{_libexecdir}/gcc/riscv-unknown-linux-gnu
103 %{_prefix}/lib/gcc/riscv64-unknown-elf
104 #%{_prefix}/lib/gcc/riscv64-unknown-linux-gnu
105 %{_prefix}/riscv64-unknown-elf
106 #%{_prefix}/riscv64-unknown-linux-gnu
107 %{_datadir}/gcc-6.1.0