%global lockver 1 %global pkgvers 0 %global scdate0 20210514 %global schash0 eafe83f2f20ef0c1e7703c361ba314b44574523c %global branch0 releases/gcc-8 %global source0 https://github.com/gcc-mirror/gcc.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} %define target avr Name: %{target}-gcc-8 Version: %(curl "https://gcc.gnu.org/git/?p=gcc.git;a=blob_plain;f=gcc/BASE-VER;hb=%{schash0}") Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Cross Compiling GNU GCC targeted at %{target} Epoch: 1 License: GPLv2+ URL: http://gcc.gnu.org Patch0: avr-gcc8-4.5.3-mint8.patch #git diff -R 62441f104eafe755f44e6e53edca9920ad91e6a0 c15ac92cfd92c9db3e609cd96aba74f7806bf4e3 gcc/lto-streamer-out.c Patch100: gcc8-PR87229-lto-streamer-out.c.diff #git diff -R 4963af8c664eb9e59c151f5a8d04794669ee0e33 d3d6b2c5e440c27ab901a777e258bf7fac2b3d7c gcc/ipa-inline.c Patch200: gcc8-PR86020-ipa-inline.c.patch #git diff -R fbbfed2085940bbd2822d7ae55d96e8351127c35 f5eb41ce2d72f465fe53a33461c635f66be04a0f gcc/passes.c Patch300: gcc8-SSA-gcc-cleanup.patch BuildRequires: git gcc-c++ flex bison texinfo BuildRequires: zlib-devel libzstd-devel libunwind-devel BuildRequires: gmp-devel mpfr-devel libmpc-devel avr-binutils %if ! (0%{?rhel} == 9) BuildRequires: autogen %endif Requires: avr-binutils Provides: avr-gcc %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} Provides: avr-gcc-c++ %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} find %{_builddir} -name SPECPARTS -exec rm -rf {} + git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git --no-pager log --format=fuller %autosetup -D -p 1 -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