summaryrefslogtreecommitdiff
path: root/packaging/qemu-accel.spec.in
diff options
context:
space:
mode:
authorNikolai Bozhenov <n.bozhenov@samsung.com>2015-02-24 15:08:25 +0300
committerNikolai Bozhenov <n.bozhenov@samsung.com>2015-04-13 16:27:01 +0300
commite749492b5947f3083f59db67da15e33d0ed9e1ea (patch)
tree94dec9086020ea745fa3923ebb174172750255e5 /packaging/qemu-accel.spec.in
parenteccd2f4643add2028c333f27011c357f8f0dc162 (diff)
downloadqemu-accel-e749492b5947f3083f59db67da15e33d0ed9e1ea.tar.gz
qemu-accel-e749492b5947f3083f59db67da15e33d0ed9e1ea.tar.bz2
qemu-accel-e749492b5947f3083f59db67da15e33d0ed9e1ea.zip
So that binutils can work with LTO objects without additional flags in qemu-accel mode Change-Id: Ic50d79a6453a51ca39e7dc6b251190e70304dae2
Diffstat (limited to 'packaging/qemu-accel.spec.in')
-rw-r--r--packaging/qemu-accel.spec.in14
1 files changed, 14 insertions, 0 deletions
diff --git a/packaging/qemu-accel.spec.in b/packaging/qemu-accel.spec.in
index a37ac97..22732df 100644
--- a/packaging/qemu-accel.spec.in
+++ b/packaging/qemu-accel.spec.in
@@ -59,6 +59,8 @@ BuildRequires: qemu-linux-user
BuildRequires: elfutils
BuildRequires: libxslt-tools
Requires: coreutils
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
Summary: Native binaries for speeding up cross compile
License: GPL-2.0
Group: Development/Cross Compilation
@@ -76,6 +78,11 @@ ExclusiveArch: x86_64 %ix86
%define binaries_binutils addr2line ar as elfedit gprof ld ld.bfd ld.gold nm objcopy objdump ranlib readelf size strings strip
%define binaries_binutils_comma %(echo %{binaries_binutils} | sed -e "s/ /,/g")
+%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}
+%define gcc_plugin_lto %{our_path}%{_libdir}/gcc/%{emulated_arch_triple_long}/%{gcc_version_dot}/liblto_plugin.so
+
%description
This package is used in %{emulated_arch_long} architecture builds using qemu to speed up builds
with native binaries.
@@ -288,11 +295,17 @@ ln -s %{our_path}/usr/sbin %{buildroot}/%{our_path}/sbin
ln -s %{our_path}/usr/bin/rpm %{buildroot}/%{our_path}/usr/bin/rpmquery
ln -s %{our_path}/usr/bin/rpm %{buildroot}/%{our_path}/usr/bin/rpmverify
+mkdir -p "%{buildroot}%{bfd_plugin_dir}"
+touch "%{buildroot}%{bfd_plugin_lto}"
+
%post
ldconfig
+"%_sbindir/update-alternatives" --install \
+ "%{bfd_plugin_lto}" "%{bfd_plugin_lto_name}" "%{gcc_plugin_lto}" 3
%postun
ldconfig
+"%_sbindir/update-alternatives" --remove %{bfd_plugin_lto_name} "%{gcc_plugin_lto}"
%files
%defattr(-,root,root)
@@ -301,5 +314,6 @@ ldconfig
/usr/%{emulated_arch_triple_long}/include
/emul
/qemu
+%ghost %{bfd_plugin_lto}
%changelog