From 31d784941e9c24a19a5499b88d72a9faf009deeb Mon Sep 17 00:00:00 2001 From: Chan Lee Date: Fri, 24 Mar 2017 10:11:03 +0900 Subject: packaging: add libgcc-32bit for multilib support Some packages need to use libgcc-32bit on 64bit build environment such as nacl toolchain. Change-Id: I07c08ec4add0637ada256c9bda004b7a503fc861 Signed-off-by: Chan Lee --- packaging/qemu-accel-aarch64.spec | 14 +++++++++++++- packaging/qemu-accel-armv7l.spec | 14 +++++++++++++- packaging/qemu-accel.spec.in | 14 +++++++++++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/packaging/qemu-accel-aarch64.spec b/packaging/qemu-accel-aarch64.spec index f5095da..6d9a9ee 100644 --- a/packaging/qemu-accel-aarch64.spec +++ b/packaging/qemu-accel-aarch64.spec @@ -65,6 +65,7 @@ License: GPL-2.0 Group: Development/Cross Compilation ExclusiveArch: x86_64 %{ix86} %ifarch x86_64 +BuildRequires: libgcc-32bit BuildRequires: glibc-32bit %define multilib 1 %endif @@ -201,8 +202,11 @@ cross_ld_symlink=$(basename `rpm -ql glibc-32bit | grep -E 'ld-linux\.so\.[[:dig # Patch all 32bit binaries to use the right ld.so though symlink mkdir -p %{buildroot}%{our_path}%{_prefix}/lib mkdir -p %{buildroot}%{our_path}/lib -for f in $(rpm -ql glibc-32bit) +for f in $(rpm -ql glibc-32bit) \ + $(rpm -ql libgcc-32bit) do + fdir=$(dirname $f) + [ ! -d %{buildroot}/%{our_path}/$fdir ] && mkdir -p %{buildroot}/%{our_path}/$fdir cp -a $f %{buildroot}/%{our_path}/$f done @@ -216,6 +220,14 @@ mv ${i686_libdir}/${cross_ld_so} ${i686_libdir}/${new_cross_ld_so} # 2. Force the symlink to point the right file. ln -sf %{our_path}/lib/${new_cross_ld_so} ${i686_libdir}/${cross_ld_symlink} + +# create symlinks for libgcc-32bit +# libgcc-32bit library is placed under %{_libdir}/gcc/%{target_arch}/${gcc_version}/32/ not just /lib for 32bit +for f in $(rpm -ql libgcc-32bit) +do + filename=$(basename $f) + ln -sf %{our_path}/$f ${i686_libdir}/${filename} +done } # create symlinks for bash diff --git a/packaging/qemu-accel-armv7l.spec b/packaging/qemu-accel-armv7l.spec index 5c392e9..cd01b04 100644 --- a/packaging/qemu-accel-armv7l.spec +++ b/packaging/qemu-accel-armv7l.spec @@ -65,6 +65,7 @@ License: GPL-2.0 Group: Development/Cross Compilation ExclusiveArch: x86_64 %{ix86} %ifarch x86_64 +BuildRequires: libgcc-32bit BuildRequires: glibc-32bit %define multilib 1 %endif @@ -201,8 +202,11 @@ cross_ld_symlink=$(basename `rpm -ql glibc-32bit | grep -E 'ld-linux\.so\.[[:dig # Patch all 32bit binaries to use the right ld.so though symlink mkdir -p %{buildroot}%{our_path}%{_prefix}/lib mkdir -p %{buildroot}%{our_path}/lib -for f in $(rpm -ql glibc-32bit) +for f in $(rpm -ql glibc-32bit) \ + $(rpm -ql libgcc-32bit) do + fdir=$(dirname $f) + [ ! -d %{buildroot}/%{our_path}/$fdir ] && mkdir -p %{buildroot}/%{our_path}/$fdir cp -a $f %{buildroot}/%{our_path}/$f done @@ -216,6 +220,14 @@ mv ${i686_libdir}/${cross_ld_so} ${i686_libdir}/${new_cross_ld_so} # 2. Force the symlink to point the right file. ln -sf %{our_path}/lib/${new_cross_ld_so} ${i686_libdir}/${cross_ld_symlink} + +# create symlinks for libgcc-32bit +# libgcc-32bit library is placed under %{_libdir}/gcc/%{target_arch}/${gcc_version}/32/ not just /lib for 32bit +for f in $(rpm -ql libgcc-32bit) +do + filename=$(basename $f) + ln -sf %{our_path}/$f ${i686_libdir}/${filename} +done } # create symlinks for bash diff --git a/packaging/qemu-accel.spec.in b/packaging/qemu-accel.spec.in index 77962c1..fc0225a 100644 --- a/packaging/qemu-accel.spec.in +++ b/packaging/qemu-accel.spec.in @@ -62,6 +62,7 @@ License: GPL-2.0 Group: Development/Cross Compilation ExclusiveArch: x86_64 %{ix86} %ifarch x86_64 +BuildRequires: libgcc-32bit BuildRequires: glibc-32bit %define multilib 1 %endif @@ -198,8 +199,11 @@ cross_ld_symlink=$(basename `rpm -ql glibc-32bit | grep -E 'ld-linux\.so\.[[:dig # Patch all 32bit binaries to use the right ld.so though symlink mkdir -p %{buildroot}%{our_path}%{_prefix}/lib mkdir -p %{buildroot}%{our_path}/lib -for f in $(rpm -ql glibc-32bit) +for f in $(rpm -ql glibc-32bit) \ + $(rpm -ql libgcc-32bit) do + fdir=$(dirname $f) + [ ! -d %{buildroot}/%{our_path}/$fdir ] && mkdir -p %{buildroot}/%{our_path}/$fdir cp -a $f %{buildroot}/%{our_path}/$f done @@ -213,6 +217,14 @@ mv ${i686_libdir}/${cross_ld_so} ${i686_libdir}/${new_cross_ld_so} # 2. Force the symlink to point the right file. ln -sf %{our_path}/lib/${new_cross_ld_so} ${i686_libdir}/${cross_ld_symlink} + +# create symlinks for libgcc-32bit +# libgcc-32bit library is placed under %{_libdir}/gcc/%{target_arch}/${gcc_version}/32/ not just /lib for 32bit +for f in $(rpm -ql libgcc-32bit) +do + filename=$(basename $f) + ln -sf %{our_path}/$f ${i686_libdir}/${filename} +done } # create symlinks for bash -- cgit v1.2.3