BuildRequires: cross-%cross_arch-glibc-devel
%endif
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
+
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
URL: http://gcc.gnu.org/
%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
+%define bfd_plugin_dir %{_bindir}/../lib/bfd-plugins
+%define bfd_plugin_lto_name liblto_plugin_%{_arch}.so
+%define bfd_plugin_lto %{bfd_plugin_dir}/%{bfd_plugin_lto_name}
+%if 0%{?cross_arch:1}
+%define gcc_plugin_lto %{targetlibsubdir}/liblto_plugin.so
+%else
+%define gcc_plugin_lto %{libsubdir}/liblto_plugin.so
+%endif
+
%prep
%setup -q -n gcc-%{version}
install -s $RPM_BUILD_ROOT/%{_prefix}/bin/%{gcc_target_arch}-g++%{binsuffix} $RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/%{_prefix}/bin/%{gcc_target_arch}-gcc%{binsuffix} $RPM_BUILD_ROOT/env/usr/bin/gcc
-for back in cc1 cc1plus; do
+for back in cc1 cc1plus collect2 lto1 lto-wrapper; do
install -s -D $RPM_BUILD_ROOT/%{targetlibsubdir}/$back $RPM_BUILD_ROOT/env%{targetlibsubdir}/$back
done
if test -f $RPM_BUILD_ROOT/%{targetlibsubdir}/liblto_plugin.so; then
rpm -q --changelog binutils > usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env
+# liblto_plugin alternatives
+mkdir -p "$RPM_BUILD_ROOT%{bfd_plugin_dir}"
+touch "$RPM_BUILD_ROOT%{bfd_plugin_lto}"
+
+%post
+"%_sbindir/update-alternatives" --install \
+ "%{bfd_plugin_lto}" "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}" 5
+
+%preun
+"%_sbindir/update-alternatives" --remove "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}"
+
+
%files
%defattr(-,root,root)
%{_prefix}/bin/*
%dir %{targetlibsubdir}
%dir %{_libdir}/gcc/%{gcc_target_arch}
%{targetlibsubdir}
+%ghost %{bfd_plugin_lto}
%files -n cross-%cross_arch-gcc49-icecream-backend
%defattr(-,root,root)
BuildRequires: cross-%cross_arch-glibc-devel
%endif
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
+
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
URL: http://gcc.gnu.org/
%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
+%define bfd_plugin_dir %{_bindir}/../lib/bfd-plugins
+%define bfd_plugin_lto_name liblto_plugin_%{_arch}.so
+%define bfd_plugin_lto %{bfd_plugin_dir}/%{bfd_plugin_lto_name}
+%if 0%{?cross_arch:1}
+%define gcc_plugin_lto %{targetlibsubdir}/liblto_plugin.so
+%else
+%define gcc_plugin_lto %{libsubdir}/liblto_plugin.so
+%endif
+
%prep
%setup -q -n gcc-%{version}
install -s $RPM_BUILD_ROOT/%{_prefix}/bin/%{gcc_target_arch}-g++%{binsuffix} $RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/%{_prefix}/bin/%{gcc_target_arch}-gcc%{binsuffix} $RPM_BUILD_ROOT/env/usr/bin/gcc
-for back in cc1 cc1plus; do
+for back in cc1 cc1plus collect2 lto1 lto-wrapper; do
install -s -D $RPM_BUILD_ROOT/%{targetlibsubdir}/$back $RPM_BUILD_ROOT/env%{targetlibsubdir}/$back
done
if test -f $RPM_BUILD_ROOT/%{targetlibsubdir}/liblto_plugin.so; then
rpm -q --changelog binutils > usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env
+# liblto_plugin alternatives
+mkdir -p "$RPM_BUILD_ROOT%{bfd_plugin_dir}"
+touch "$RPM_BUILD_ROOT%{bfd_plugin_lto}"
+
+%post
+"%_sbindir/update-alternatives" --install \
+ "%{bfd_plugin_lto}" "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}" 5
+
+%preun
+"%_sbindir/update-alternatives" --remove "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}"
+
+
%files
%defattr(-,root,root)
%{_prefix}/bin/*
%dir %{targetlibsubdir}
%dir %{_libdir}/gcc/%{gcc_target_arch}
%{targetlibsubdir}
+%ghost %{bfd_plugin_lto}
%files -n cross-%cross_arch-gcc49-icecream-backend
%defattr(-,root,root)
BuildRequires: cross-%cross_arch-glibc-devel
%endif
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
+
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
URL: http://gcc.gnu.org/
%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
+%define bfd_plugin_dir %{_bindir}/../lib/bfd-plugins
+%define bfd_plugin_lto_name liblto_plugin_%{_arch}.so
+%define bfd_plugin_lto %{bfd_plugin_dir}/%{bfd_plugin_lto_name}
+%if 0%{?cross_arch:1}
+%define gcc_plugin_lto %{targetlibsubdir}/liblto_plugin.so
+%else
+%define gcc_plugin_lto %{libsubdir}/liblto_plugin.so
+%endif
+
%prep
%setup -q -n gcc-%{version}
install -s $RPM_BUILD_ROOT/%{_prefix}/bin/%{gcc_target_arch}-g++%{binsuffix} $RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/%{_prefix}/bin/%{gcc_target_arch}-gcc%{binsuffix} $RPM_BUILD_ROOT/env/usr/bin/gcc
-for back in cc1 cc1plus; do
+for back in cc1 cc1plus collect2 lto1 lto-wrapper; do
install -s -D $RPM_BUILD_ROOT/%{targetlibsubdir}/$back $RPM_BUILD_ROOT/env%{targetlibsubdir}/$back
done
if test -f $RPM_BUILD_ROOT/%{targetlibsubdir}/liblto_plugin.so; then
rpm -q --changelog binutils > usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env
+# liblto_plugin alternatives
+mkdir -p "$RPM_BUILD_ROOT%{bfd_plugin_dir}"
+touch "$RPM_BUILD_ROOT%{bfd_plugin_lto}"
+
+%post
+"%_sbindir/update-alternatives" --install \
+ "%{bfd_plugin_lto}" "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}" 5
+
+%preun
+"%_sbindir/update-alternatives" --remove "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}"
+
+
%files
%defattr(-,root,root)
%{_prefix}/bin/*
%dir %{targetlibsubdir}
%dir %{_libdir}/gcc/%{gcc_target_arch}
%{targetlibsubdir}
+%ghost %{bfd_plugin_lto}
%files -n cross-%cross_arch-gcc49-icecream-backend
%defattr(-,root,root)
BuildRequires: cross-%cross_arch-glibc-devel
%endif
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
+
# COMMON-BEGIN
# COMMON-END
install -s \$RPM_BUILD_ROOT/%{_prefix}/bin/%{gcc_target_arch}-gcc%{binsuffix} \
\$RPM_BUILD_ROOT/env/usr/bin/gcc
-for back in cc1 cc1plus; do
+for back in cc1 cc1plus collect2 lto1 lto-wrapper; do
install -s -D \$RPM_BUILD_ROOT/%{targetlibsubdir}/\$back \
\$RPM_BUILD_ROOT/env%{targetlibsubdir}/\$back
done
rpm -q --changelog binutils > usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env
+# liblto_plugin alternatives
+mkdir -p "\$RPM_BUILD_ROOT%{bfd_plugin_dir}"
+touch "\$RPM_BUILD_ROOT%{bfd_plugin_lto}"
+
+%post
+"%_sbindir/update-alternatives" --install \\
+ "%{bfd_plugin_lto}" "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}" 5
+
+%preun
+"%_sbindir/update-alternatives" --remove "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}"
+
+
%files
%defattr(-,root,root)
%{_prefix}/bin/*
%dir %{targetlibsubdir}
%dir %{_libdir}/gcc/%{gcc_target_arch}
%{targetlibsubdir}
+%ghost %{bfd_plugin_lto}
%files -n cross-%cross_arch-gcc@base_ver@-icecream-backend
%defattr(-,root,root)
%define selfconflict() %1
+
Name: gcc@base_ver@
# For unknown reason when libgcc.so is built with gold, it causes python to
# make syscalls with zero-length buffers. That's why we disable gold for gcc
BuildRequires: gdb
%endif
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
+
%define separate_bi32 0
%define separate_bi64 0
%ifarch ppc sparcv9
%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
+%define bfd_plugin_dir %{_bindir}/../lib/bfd-plugins
+%define bfd_plugin_lto_name liblto_plugin_%{_arch}.so
+%define bfd_plugin_lto %{bfd_plugin_dir}/%{bfd_plugin_lto_name}
+%if 0%{?cross_arch:1}
+%define gcc_plugin_lto %{targetlibsubdir}/liblto_plugin.so
+%else
+%define gcc_plugin_lto %{libsubdir}/liblto_plugin.so
+%endif
+
# COMMON-END
# Versionspecific directories
%find_lang libstdc++
cat cpplib%{binsuffix}.lang gcc%{binsuffix}.lang > gcc@base_ver@-locale.lang
+# liblto_plugin alternatives
+mkdir -p $RPM_BUILD_ROOT%{bfd_plugin_dir}
+touch $RPM_BUILD_ROOT%{bfd_plugin_lto}
+
+%post
+"%_sbindir/update-alternatives" --install \
+ "%{bfd_plugin_lto}" "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}" 10
+
+%preun
+"%_sbindir/update-alternatives" --remove "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}"
+
%post info
%install_info --info-dir=%{_infodir} %{_infodir}/cpp%{binsuffix}.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/cppinternals%{binsuffix}.info.gz
%{libsubdir}/lto1
%{libsubdir}/lto-wrapper
%{libsubdir}/liblto_plugin.so*
+%ghost %{bfd_plugin_lto}
%{libsubdir}/include-fixed/README
%{libsubdir}/include-fixed/limits.h
%{libsubdir}/include-fixed/syslimits.h
%define selfconflict() %1
+
Name: gcc49
# For unknown reason when libgcc.so is built with gold, it causes python to
# make syscalls with zero-length buffers. That's why we disable gold for gcc
BuildRequires: gdb
%endif
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
+
%define separate_bi32 0
%define separate_bi64 0
%ifarch ppc sparcv9
%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
+%define bfd_plugin_dir %{_bindir}/../lib/bfd-plugins
+%define bfd_plugin_lto_name liblto_plugin_%{_arch}.so
+%define bfd_plugin_lto %{bfd_plugin_dir}/%{bfd_plugin_lto_name}
+%if 0%{?cross_arch:1}
+%define gcc_plugin_lto %{targetlibsubdir}/liblto_plugin.so
+%else
+%define gcc_plugin_lto %{libsubdir}/liblto_plugin.so
+%endif
+
# Versionspecific directories
%define versmainlibdir %{libsubdir}
%find_lang libstdc++
cat cpplib%{binsuffix}.lang gcc%{binsuffix}.lang > gcc49-locale.lang
+# liblto_plugin alternatives
+mkdir -p $RPM_BUILD_ROOT%{bfd_plugin_dir}
+touch $RPM_BUILD_ROOT%{bfd_plugin_lto}
+
+%post
+"%_sbindir/update-alternatives" --install \
+ "%{bfd_plugin_lto}" "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}" 10
+
+%preun
+"%_sbindir/update-alternatives" --remove "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}"
+
%post info
%install_info --info-dir=%{_infodir} %{_infodir}/cpp%{binsuffix}.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/cppinternals%{binsuffix}.info.gz
%{libsubdir}/lto1
%{libsubdir}/lto-wrapper
%{libsubdir}/liblto_plugin.so*
+%ghost %{bfd_plugin_lto}
%{libsubdir}/include-fixed/README
%{libsubdir}/include-fixed/limits.h
%{libsubdir}/include-fixed/syslimits.h