%define cross_arch riscv64 %define cross_triplet riscv64-none-elf %define cross_sysroot %{_prefix}/%{cross_triplet}/sys-root %global versionyear 2021 %global versionmonth 04 %global versionday 08 %global gccversion 10.2.0 Name: %{cross_triplet}-gdb Version: %{versionyear}%{versionmonth}%{versionday} Release: 1%{?dist} Summary: GDB for (remote) debugging (%{cross_triplet}) Group: Development/Debuggers License: GPLv3+ URL: https://github.com/riscv/riscv-gnu-toolchain Source0: riscv-gnu-toolchain-%{versionyear}.%{versionmonth}.%{versionday}.tar.bz2 BuildRequires: texinfo BuildRequires: ncurses-devel BuildRequires: python-devel BuildRequires: texinfo-tex BuildRequires: expat-devel BuildRequires: flex BuildRequires: bison BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: mpfr-devel %if 0%{?fedora} >= 27 BuildRequires: libipt-devel %endif BuildRequires: python2-devel %if 0%{?fedora} >= 29 || 0%{?rhel} >= 8 BuildRequires: python-unversioned-command %endif %description This is a version of GDB, the GNU Project debugger, for (remote) debugging %{cross_triplet} binaries. GDB allows you to see and modify what is going on inside another program while it is executing. %package devel Summary: GDB for (remote) debugging (%{cross_triplet}) Group: Development/Debuggers Requires: %{name} = %{version}-%{release} %description devel This is a version of GDB, the GNU Project debugger, for (remote) debugging %{cross_triplet} binaries. GDB allows you to see and modify what is going on inside another program while it is executing. This package contains development headers for working with gdb. %prep %autosetup -n riscv-gnu-toolchain %build cd %{_builddir}/riscv-gnu-toolchain mkdir -p gdb-build cd gdb-build ../riscv-gdb/configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --infodir=%{_infodir} \ --host=%{_target_platform} \ --build=%{_target_platform} \ --target=%{cross_triplet} \ --disable-nls \ --disable-sim \ --disable-gas \ --disable-binutils \ --disable-ld \ --disable-gprof \ --with-libexpat \ --with-lzma=no \ --with-system-gdbinit=%{_prefix}/%{cross_triplet}/lib/gdbinit \ --with-python=yes \ --with-gdb-datadir=%{_datarootdir}/gdb-%{cross_triplet}-%{gccversion} make %{?_smp_mflags} %install cd %{_builddir}/riscv-gnu-toolchain/gdb-build make DESTDIR=%{buildroot} install #make DESTDIR=%{buildroot} install-html install-pdf # we don't want these as this is a cross-compiler rm -rf $RPM_BUILD_ROOT%{_infodir} rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a # Get rid of the shared lib rm -f $RPM_BUILD_ROOT%{_libdir}/lib%{cross_triplet}-sim.a # Non-linux targets don't have syscalls rm -rf $RPM_BUILD_ROOT%{_prefix}/share/gdb/syscalls %files %license riscv-gdb/{COPYING?,COPYING?.LIB} %{_bindir}/%{cross_triplet}-* %{_mandir}/man1/%{cross_triplet}-*.1.gz %{_mandir}/man5/%{cross_triplet}-*.5.gz %dir %{_datarootdir}/gdb-%{cross_triplet}-%{gccversion} %{_datarootdir}/gdb-%{cross_triplet}-%{gccversion}/* %files devel %defattr(-,root,root,-) %{_includedir}/gdb/jit-reader.h %changelog * Thu Apr 08 2021 Thomas Sailer - 20210408-1 - update