%global pkgvers 0 %global scdate0 20230426 %global sctags0 releases/gcc-13.1.0 %global scfilt0 releases/gcc.*^{} %global source0 https://github.com/gcc-mirror/gcc.git %define target avr Name: %{target}-gcc Version: %(curl -s "https://gcc.gnu.org/git/?p=gcc.git;a=blob_plain;f=gcc/BASE-VER;hb=refs/tags/%{sctags0}") Release: %{scdate0}.%{pkgvers}%{?dist} Summary: Cross Compiling GNU GCC targeted at %{target} Epoch: 1 License: GPLv2+ URL: http://gcc.gnu.org BuildRequires: git gcc-c++ flex bison texinfo BuildRequires: zlib-devel libzstd-devel libunwind-devel BuildRequires: gmp-devel mpfr-devel libmpc-devel avr-binutils Requires: avr-binutils %if ! (0%{?rhel} == 9) BuildRequires: autogen %endif %global __brp_strip_lto %{nil} %global __os_install_post /usr/lib/rpm/brp-compress %global __provides_exclude_from ^%{_prefix}/lib/gcc/%{target}/.*$ %global __requires_exclude_from ^%{_prefix}/lib/gcc/%{target}/.*$ %define maj_ver %(echo "%{version}" | cut -d'.' -f1) %description This is a Cross Compiling version of GNU GCC, which can be used to compile for the %{target} platform, instead of for the native %{_arch} platform. %package c++ Summary: Cross Compiling GNU GCC targeted at %{target} Requires: %{name} = %{epoch}:%{version}-%{release} %description c++ This package contains the Cross Compiling version of g++, which can be used to compile c++ code for the %{target} platform, instead of for the native %{_arch} platform. %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{sctags0} %{source0} . git fetch --depth 1 origin %{sctags0} git reset --hard %{sctags0} git --no-pager log --format=fuller %autosetup -D -p 0 -T -c -n %{name} %build contrib/gcc_update --touch mkdir -p build-%{target} pushd build-%{target} %global optflags $(echo %{optflags} | sed 's|-Werror=format-security||g') ../configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --infodir=%{_infodir} \ --with-gcc-major-version-only \ --target=%{target} \ --with-zstd \ --with-system-zlib \ --with-system-libunwind \ --enable-lto \ --enable-languages=c,c++,lto \ --enable-version-specific-runtime-libs \ --disable-nls \ --disable-libssp %make_build popd %install pushd build-%{target} make install DESTDIR=%{buildroot} popd # we don't want these as we are a cross version rm -r %{buildroot}%{_infodir} rm -r %{buildroot}%{_mandir}/man7 rm %{buildroot}%{_libdir}/libiberty.a ||: rm %{buildroot}%{_libdir}/libcc1* ||: rm -r %{buildroot}%{_bindir}/lto-dump ||: # and these aren't usefull for embedded targets rm -r %{buildroot}/usr/lib/gcc/%{target}/%{maj_ver}/install-tools ||: rm -r %{buildroot}%{_libexecdir}/gcc/%{target}/%{maj_ver}/install-tools ||: %files %license COPYING* %doc README %{_bindir}/%{target}-* %dir /usr/lib/gcc %dir /usr/lib/gcc/%{target} /usr/lib/gcc/%{target}/%{maj_ver} %dir %{_libexecdir}/gcc %dir %{_libexecdir}/gcc/%{target} %{_libexecdir}/gcc/%{target}/%{maj_ver} %{_mandir}/man1/%{target}-*.1.gz %exclude %{_bindir}/%{target}-?++ %exclude %{_libexecdir}/gcc/%{target}/%{maj_ver}/cc1plus %exclude %{_mandir}/man1/%{target}-g++.1.gz %files c++ %{_bindir}/%{target}-?++ %{_libexecdir}/gcc/%{target}/%{maj_ver}/cc1plus %{_mandir}/man1/%{target}-g++.1.gz %changelog * Sat Jun 18 2022 Cristian Balint - git update releases