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 # Kill check-buildroot and check-rpaths.
10 %global __arch_install_post /bin/true
12 Name: riscv-gnu-toolchain
14 Release: 0.5.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-@BINUTILS_VERSION@.tar.gz
22 Source2: http://mirrors.kernel.org/gnu/glibc/glibc-@GLIBC_VERSION@.tar.gz
23 Source3: http://mirrors.kernel.org/gnu/gcc/gcc-@GCC_VERSION@/gcc-@GCC_VERSION@.tar.gz
24 Source4: ftp://sourceware.org/pub/newlib/newlib-@NEWLIB_VERSION@.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@
58 # This only works if you build in a build subdirectory.
61 ../configure --prefix=%{_prefix} --libdir=%{_libdir}
63 # The ordinary Makefile downloads upstream GNU packages. Instead we
64 # provide these as local files. Note this is "DISTDIR" not "DESTDIR".
65 export DISTDIR=%{_sourcedir}
67 # Since the Makefile installs as it goes along, clean the buildroot
68 # now (instead of at the top of install).
69 rm -rf $RPM_BUILD_ROOT
70 mkdir -p $RPM_BUILD_ROOT
71 export DESTDIR=$RPM_BUILD_ROOT
73 # We need to use the tools we built as we go along.
74 export PATH=$RPM_BUILD_ROOT/usr/bin:$RPM_BUILD_ROOT/bin:$PATH
78 # The 'make linux' rule builds GCC linked against glibc (instead of
81 make linux SYSROOT=$RPM_BUILD_ROOT%{_prefix}/sysroot
87 # Not needed since the make installs as it goes along.
89 #make install DESTDIR=$RPM_BUILD_ROOT
92 # Remove some documentation, language files
93 rm -r $RPM_BUILD_ROOT%{_datadir}/info
94 rm -r $RPM_BUILD_ROOT%{_mandir}
95 rm -r $RPM_BUILD_ROOT%{_datadir}/locale
97 # Remove this libtool linker file.
98 rm $RPM_BUILD_ROOT%{_libdir}/libcc1.la
103 %{_bindir}/riscv64-unknown-elf-*
104 %{_bindir}/riscv64-unknown-linux-gnu-*
106 %{_libdir}/libcc1.so.0
107 %{_libdir}/libcc1.so.0.0.0
108 %{_libexecdir}/gcc/riscv64-unknown-elf
109 %{_libexecdir}/gcc/riscv64-unknown-linux-gnu
110 %{_prefix}/lib/gcc/riscv64-unknown-elf
111 %{_prefix}/lib/gcc/riscv64-unknown-linux-gnu
112 %{_prefix}/riscv64-unknown-elf
113 %{_prefix}/riscv64-unknown-linux-gnu
114 %{_datadir}/gcc-@GCC_VERSION@