From 7aee9ce157d785d173ebbc8ef6da3c35aab5001e Mon Sep 17 00:00:00 2001 From: Slava Barinov Date: Thu, 23 Mar 2017 11:48:27 +0300 Subject: [PATCH] Stop patching libc.so with patchelf Libraries shouldn't be patched, only executables should. Change-Id: I3a232d4b40ae61f8b9aab15dae0f884c63b5c47c Signed-off-by: Slava Barinov --- packaging/qemu-accel-aarch64.spec | 10 +++++----- packaging/qemu-accel-armv7l.spec | 10 +++++----- packaging/qemu-accel.spec.in | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packaging/qemu-accel-aarch64.spec b/packaging/qemu-accel-aarch64.spec index 461ca7a..f5095da 100644 --- a/packaging/qemu-accel-aarch64.spec +++ b/packaging/qemu-accel-aarch64.spec @@ -165,11 +165,11 @@ function patch_binary { local rtld=$2 # We don't need to accelerate shell scripts local filetype=`file --brief $binary` - [[ x"$filetype" == x"POSIX shell script"* ]] && continue + [[ x"$filetype" == x"POSIX shell script"* ]] && return local outfile=%{buildroot}/%{our_path}/$binary - [ ! -e $binary ] && echo "WARNING: File '${binary}' not found, ignoring" && continue - [ -f $outfile ] && echo "WARNING: File '${outfile}' exists, ignoring" && continue + [ ! -e $binary ] && echo "WARNING: File '${binary}' not found, ignoring" && return + [ -f $outfile ] && echo "WARNING: File '${outfile}' exists, ignoring" && return mkdir -p ${outfile%/*} cp -aL $binary $outfile objdump -s -j .rodata -j .data $outfile | sed 's/^ *\([a-z0-9]*\)/\1:/' | \ @@ -180,7 +180,7 @@ function patch_binary { exit 1 fi rm -f $outfile.data - [ "$binary" == "$rtld" ] && continue + [ "$binary" == "$rtld" ] && return patchelf --set-rpath "%{our_path}/%{_libdir}" $outfile # not all binaries have an .interp section if patchelf --print-interpreter $outfile 1>/dev/null 2>/dev/null; then @@ -203,7 +203,7 @@ mkdir -p %{buildroot}%{our_path}%{_prefix}/lib mkdir -p %{buildroot}%{our_path}/lib for f in $(rpm -ql glibc-32bit) do - patch_binary $f /lib/${cross_ld_symlink} + cp -a $f %{buildroot}/%{our_path}/$f done # Now we have to change the ld.so name to prevent name clashing in armv7l repos diff --git a/packaging/qemu-accel-armv7l.spec b/packaging/qemu-accel-armv7l.spec index dd16df5..5c392e9 100644 --- a/packaging/qemu-accel-armv7l.spec +++ b/packaging/qemu-accel-armv7l.spec @@ -165,11 +165,11 @@ function patch_binary { local rtld=$2 # We don't need to accelerate shell scripts local filetype=`file --brief $binary` - [[ x"$filetype" == x"POSIX shell script"* ]] && continue + [[ x"$filetype" == x"POSIX shell script"* ]] && return local outfile=%{buildroot}/%{our_path}/$binary - [ ! -e $binary ] && echo "WARNING: File '${binary}' not found, ignoring" && continue - [ -f $outfile ] && echo "WARNING: File '${outfile}' exists, ignoring" && continue + [ ! -e $binary ] && echo "WARNING: File '${binary}' not found, ignoring" && return + [ -f $outfile ] && echo "WARNING: File '${outfile}' exists, ignoring" && return mkdir -p ${outfile%/*} cp -aL $binary $outfile objdump -s -j .rodata -j .data $outfile | sed 's/^ *\([a-z0-9]*\)/\1:/' | \ @@ -180,7 +180,7 @@ function patch_binary { exit 1 fi rm -f $outfile.data - [ "$binary" == "$rtld" ] && continue + [ "$binary" == "$rtld" ] && return patchelf --set-rpath "%{our_path}/%{_libdir}" $outfile # not all binaries have an .interp section if patchelf --print-interpreter $outfile 1>/dev/null 2>/dev/null; then @@ -203,7 +203,7 @@ mkdir -p %{buildroot}%{our_path}%{_prefix}/lib mkdir -p %{buildroot}%{our_path}/lib for f in $(rpm -ql glibc-32bit) do - patch_binary $f /lib/${cross_ld_symlink} + cp -a $f %{buildroot}/%{our_path}/$f done # Now we have to change the ld.so name to prevent name clashing in armv7l repos diff --git a/packaging/qemu-accel.spec.in b/packaging/qemu-accel.spec.in index bb78149..77962c1 100644 --- a/packaging/qemu-accel.spec.in +++ b/packaging/qemu-accel.spec.in @@ -162,11 +162,11 @@ function patch_binary { local rtld=$2 # We don't need to accelerate shell scripts local filetype=`file --brief $binary` - [[ x"$filetype" == x"POSIX shell script"* ]] && continue + [[ x"$filetype" == x"POSIX shell script"* ]] && return local outfile=%{buildroot}/%{our_path}/$binary - [ ! -e $binary ] && echo "WARNING: File '${binary}' not found, ignoring" && continue - [ -f $outfile ] && echo "WARNING: File '${outfile}' exists, ignoring" && continue + [ ! -e $binary ] && echo "WARNING: File '${binary}' not found, ignoring" && return + [ -f $outfile ] && echo "WARNING: File '${outfile}' exists, ignoring" && return mkdir -p ${outfile%/*} cp -aL $binary $outfile objdump -s -j .rodata -j .data $outfile | sed 's/^ *\([a-z0-9]*\)/\1:/' | \ @@ -177,7 +177,7 @@ function patch_binary { exit 1 fi rm -f $outfile.data - [ "$binary" == "$rtld" ] && continue + [ "$binary" == "$rtld" ] && return patchelf --set-rpath "%{our_path}/%{_libdir}" $outfile # not all binaries have an .interp section if patchelf --print-interpreter $outfile 1>/dev/null 2>/dev/null; then @@ -200,7 +200,7 @@ mkdir -p %{buildroot}%{our_path}%{_prefix}/lib mkdir -p %{buildroot}%{our_path}/lib for f in $(rpm -ql glibc-32bit) do - patch_binary $f /lib/${cross_ld_symlink} + cp -a $f %{buildroot}/%{our_path}/$f done # Now we have to change the ld.so name to prevent name clashing in armv7l repos -- 2.7.4