packages: adobe-flash/adobe-flash.spec, adobe-flash/memcpy-to-memmove.sh (N...

arekm arekm at pld-linux.org
Sun Mar 6 16:44:16 CET 2011


Author: arekm                        Date: Sun Mar  6 15:44:16 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- 64bit flash need to be 'patched' to avoid audio problems with glibc 2.13

---- Files affected:
packages/adobe-flash:
   adobe-flash.spec (1.147 -> 1.148) , memcpy-to-memmove.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/adobe-flash/adobe-flash.spec
diff -u packages/adobe-flash/adobe-flash.spec:1.147 packages/adobe-flash/adobe-flash.spec:1.148
--- packages/adobe-flash/adobe-flash.spec:1.147	Mon Feb 21 17:25:54 2011
+++ packages/adobe-flash/adobe-flash.spec	Sun Mar  6 16:44:11 2011
@@ -41,6 +41,7 @@
 Source3:	http://svn.pld-linux.org/svn/license-installer/license-installer.sh
 # Source3-md5:	329c25f457fea66ec502b7ef70cb9ede
 %endif
+Source4:	memcpy-to-memmove.sh
 URL:		http://www.adobe.com/products/flashplayer/
 %if %{with license_agreement}
 BuildRequires:	rpmbuild(macros) >= 1.357
@@ -94,6 +95,14 @@
 	: wrong version
 	exit 1
 fi
+
+%ifarch %{x8664}
+# Bug #354073: Patch binary to use memmove instead of memcpy from
+# Redhat's bug https://bugzilla.redhat.com/show_bug.cgi?id=638477#c94
+cp libflashplayer.so libflashplayer.so.orig
+/bin/bash %{SOURCE4} libflashplayer.so \
+|| (echo "memcpy-to-memmove.sh failed" && exit 1)
+%endif
 %endif
 
 %install
@@ -152,6 +161,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.148  2011/03/06 15:44:11  arekm
+- 64bit flash need to be 'patched' to avoid audio problems with glibc 2.13
+
 Revision 1.147  2011/02/21 16:25:54  glen
 - move mms.cfg to package as source
 

================================================================
Index: packages/adobe-flash/memcpy-to-memmove.sh
diff -u /dev/null packages/adobe-flash/memcpy-to-memmove.sh:1.1
--- /dev/null	Sun Mar  6 16:44:16 2011
+++ packages/adobe-flash/memcpy-to-memmove.sh	Sun Mar  6 16:44:11 2011
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Quick and dirty, but inefficient shellscript that
+# turns all memcpy calls into memmove calls
+# From Ray Strode
+
+set -e
+
+INPUT="$1"
+
+MEMCPY=0x$(objdump -S -j .plt $INPUT | grep memcpy |awk '{ print $1 }')
+[ $MEMCPY = "0x" ] && echo "Can't find memcpy call in $INPUT PLT" 1>&2 && exit 1
+
+MEMMOVE=0x$(objdump -S -j .plt $INPUT | grep memmove |awk '{ print $1 }')
+[ $MEMMOVE = "0x" ] && echo "Can't find memmove call in $INPUT PLT" 1>&2 && exit 2
+
+DELTA=$(($MEMMOVE - $MEMCPY))
+MEMCPY="$(printf '%x' $MEMCPY)"
+
+TEMP_OUTPUT="$(mktemp)"
+trap "rm -f $TEMP_OUTPUT" ERR
+
+cp $INPUT $TEMP_OUTPUT
+objdump -S -j .text $INPUT | while read offset e8 byte1 byte2 byte3 byte4 call call_offset rest; do
+    test "$call_offset" = "$MEMCPY" || continue;
+
+    OFFSET=$(printf "0x%x" $((0x${offset%:} + 1)))
+    NUMBER="0x${byte4}${byte3}${byte2}${byte1}"
+    echo -n "Changing call at offset $OFFSET from [${byte1} ${byte2} ${byte3} ${byte4}]"
+    NUMBER=$(printf "0x%08x" $(($NUMBER + $DELTA)))
+
+    BYTE1=$(printf "%02x" $((($NUMBER >> 24) & 0xff)))
+    BYTE2=$(printf "%02x" $((($NUMBER >> 16) & 0xff)))
+    BYTE3=$(printf "%02x" $((($NUMBER >>  8) & 0xff)))
+    BYTE4=$(printf "%02x" $((($NUMBER >>  0) & 0xff)))
+
+    echo " to [${BYTE4} ${BYTE3} ${BYTE2} ${BYTE1}]"
+    echo -ne "\x$BYTE4\x$BYTE3\x$BYTE2\x$BYTE1" | dd of=$TEMP_OUTPUT bs=1 seek=$(($OFFSET)) count=4 conv=notrunc 2> /dev/null
+done
+
+mv $TEMP_OUTPUT $INPUT
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/adobe-flash/adobe-flash.spec?r1=1.147&r2=1.148&f=u



More information about the pld-cvs-commit mailing list