From: Nikolai Bozhenov Date: Tue, 24 Feb 2015 12:08:25 +0000 (+0300) Subject: Install cross LTO plugin when installing qemu-accel X-Git-Tag: accepted/tizen/3.0.2015.q2/common/20150616.100208^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F37%2F38137%2F1;p=platform%2Fupstream%2Fqemu-accel.git Install cross LTO plugin when installing qemu-accel So that binutils can work with LTO objects without additional flags in qemu-accel mode Change-Id: Ic50d79a6453a51ca39e7dc6b251190e70304dae2 --- diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf index 73d841c..8bfedf9 100644 --- a/packaging/baselibs.conf +++ b/packaging/baselibs.conf @@ -63,6 +63,22 @@ qemu-accel-armv7l post " ln -s /usr/lib/gcc/armv7l-tizen-linux-gnueabi/${GCCVER}/$f /usr/armv7l-tizen-linux-gnueabi/bin/$f;" post " done" post "fi" + post "" + post "HOST_ARCH=`echo -n %{_host_cpu} | sed -e 's/i.86/i586/'`" + post "ACCEL_DIR=/emul/$HOST_ARCH-for-arm" + post "mkdir -p %_bindir/../lib/bfd-plugins" + post "%_sbindir/update-alternatives --install \" + post " %_bindir/../lib/bfd-plugins/liblto_plugin_%{_arch}.so \" + post " liblto_plugin_%{_arch}.so \" + post " $ACCEL_DIR/usr/lib/gcc/armv7l-tizen-linux-gnueabi/${GCCVER}/liblto_plugin.so \" + post " 3" + post "" + postun "HOST_ARCH=`echo -n %{_host_cpu} | sed -e 's/i.86/i586/'`" + postun "ACCEL_DIR=/emul/$HOST_ARCH-for-arm" + postun "GCCVER=$(LANG=C gcc --version | head -1 | sed -e "s/^.*gcc[^0-9]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\1.\2/") " + postun "%_sbindir/update-alternatives --remove \" + postun " liblto_plugin_%{_arch}.so \" + postun " $ACCEL_DIR/usr/lib/gcc/armv7l-tizen-linux-gnueabi/${GCCVER}/liblto_plugin.so" +/ qemu-accel-aarch64 @@ -129,4 +145,20 @@ qemu-accel-aarch64 post " ln -s /usr/lib64/gcc/aarch64-tizen-linux/${GCCVER}/$f /usr/lib/$f;" post " done" post "fi" + post "" + post "HOST_ARCH=`echo -n %{_host_cpu} | sed -e 's/i.86/i586/'`" + post "ACCEL_DIR=/emul/$HOST_ARCH-for-aarch64" + post "mkdir -p %_bindir/../lib/bfd-plugins" + post "%_sbindir/update-alternatives --install \" + post " %_bindir/../lib/bfd-plugins/liblto_plugin_%{_arch}.so \" + post " liblto_plugin_%{_arch}.so \" + post " $ACCEL_DIR/usr/lib/gcc/aarch64-tizen-linux/${GCCVER}/liblto_plugin.so \" + post " 3" + post "" + postun "HOST_ARCH=`echo -n %{_host_cpu} | sed -e 's/i.86/i586/'`" + postun "ACCEL_DIR=/emul/$HOST_ARCH-for-aarch64" + postun "GCCVER=$(LANG=C gcc --version | head -1 | sed -e "s/^.*gcc[^0-9]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\1.\2/") " + postun "%_sbindir/update-alternatives --remove \" + postun " liblto_plugin_%{_arch}.so \" + postun " $ACCEL_DIR/usr/lib/gcc/aarch64-tizen-linux/${GCCVER}/liblto_plugin.so" +/ diff --git a/packaging/qemu-accel-aarch64.spec b/packaging/qemu-accel-aarch64.spec index e4f4b26..5536629 100644 --- a/packaging/qemu-accel-aarch64.spec +++ b/packaging/qemu-accel-aarch64.spec @@ -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 diff --git a/packaging/qemu-accel-armv7l.spec b/packaging/qemu-accel-armv7l.spec index 358b6d9..a22c5ed 100644 --- a/packaging/qemu-accel-armv7l.spec +++ b/packaging/qemu-accel-armv7l.spec @@ -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 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