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 Name: riscv-gnu-toolchain
11 Release: 0.3.git@SHORTCOMMIT@%{?dist}
12 Summary: RISC-V GNU cross-toolchain, containing binutils and GCC
13 License: GPLv2+ and LGPLv2+ and BSD
15 URL: https://github.com/riscv/riscv-qemu
16 Source0: https://github.com/riscv/%{name}/archive/@COMMIT@/%{name}-@SHORTCOMMIT@.tar.gz
18 Source1: http://mirrors.kernel.org/gnu/binutils/binutils-@BINUTILS_VERSION@.tar.gz
19 Source2: http://mirrors.kernel.org/gnu/glibc/glibc-@GLIBC_VERSION@.tar.gz
20 Source3: http://mirrors.kernel.org/gnu/gcc/gcc-@GCC_VERSION@/gcc-@GCC_VERSION@.tar.gz
21 Source4: ftp://sourceware.org/pub/newlib/newlib-@NEWLIB_VERSION@.tar.gz
23 # XXX These BuildRequires are just culled from the GCC spec
24 # and probably overestimate the real requirements.
25 BuildRequires: binutils
26 BuildRequires: glibc-static
27 BuildRequires: zlib-devel, gettext, bison, flex
28 BuildRequires: texinfo, texinfo-tex, /usr/bin/pod2man
29 BuildRequires: systemtap-sdt-devel
30 BuildRequires: gmp-devel, mpfr-devel, libmpc-devel
31 BuildRequires: hostname, procps
33 BuildRequires: glibc-devel
34 BuildRequires: elfutils-devel
35 BuildRequires: elfutils-libelf-devel
37 BuildRequires: glibc-devel
38 BuildRequires: libunwind
40 BuildRequires: isl-devel
41 BuildRequires: doxygen
42 BuildRequires: graphviz, texlive-collection-latex
46 This is the RISC-V fork of the GNU cross-compiler toolchain. It
47 includes binutils and GCC.
51 %setup -q -n %{name}-@COMMIT@
57 # The ordinary Makefile downloads upstream GNU packages. Instead we
58 # provide these as local files. Note this is "DISTDIR" not "DESTDIR".
59 export DISTDIR=%{_sourcedir}
61 # Since the Makefile installs as it goes along, set DESTDIR too, and
62 # clean the buildroot now (instead of at the top of install).
63 export DESTDIR=$RPM_BUILD_ROOT
64 rm -rf $RPM_BUILD_ROOT
65 mkdir -p $RPM_BUILD_ROOT
67 # We need to use the tools we built as we go along.
68 export PATH=$RPM_BUILD_ROOT%{_bindir}:$PATH
72 # The 'make linux' rule builds GCC linked against glibc (instead of
73 # newlib). However I couldn't make this work, and it's not really
79 # Not needed since the make installs as it goes along.
80 #make install DESTDIR=$RPM_BUILD_ROOT
82 # Remove some documentation, language files
83 rm -r $RPM_BUILD_ROOT%{_datadir}/info
84 rm -r $RPM_BUILD_ROOT%{_mandir}
85 rm -r $RPM_BUILD_ROOT%{_datadir}/locale
87 # Remove this libtool linker file.
88 rm $RPM_BUILD_ROOT%{_libdir}/libcc1.la
92 %doc README.md LICENSE
93 %{_bindir}/riscv64-unknown-elf-*
94 #%{_bindir}/riscv64-unknown-linux-gnu-*
96 %{_libdir}/libcc1.so.0
97 %{_libdir}/libcc1.so.0.0.0
98 %{_libexecdir}/gcc/riscv64-unknown-elf
99 #%{_libexecdir}/gcc/riscv-unknown-linux-gnu
100 %{_prefix}/lib/gcc/riscv64-unknown-elf
101 #%{_prefix}/lib/gcc/riscv64-unknown-linux-gnu
102 %{_prefix}/riscv64-unknown-elf
103 #%{_prefix}/riscv64-unknown-linux-gnu
104 %{_datadir}/gcc-@GCC_VERSION@