--- /tmp/adobe-flash-10.2.152.27_p201011173-r1.ebuild 2011-02-11 18:08:15.000000000 +0200 +++ adobe-flash-10.2.152.27_p201011173-r1.ebuild 2011-02-11 18:22:55.000000000 +0200 @@ -3,7 +3,7 @@ # $Header: /var/cvsroot/gentoo-x86/www-plugins/adobe-flash/adobe-flash-10.2.152.27_p201011173-r1.ebuild,v 1.1 2011/02/11 13:54:15 lack Exp $ EAPI=3 -inherit rpm nsplugins multilib toolchain-funcs versionator +inherit rpm nsplugins multilib toolchain-funcs versionator flag-o-matic # Note: There is no "square" for 32-bit! Just use the current 32-bit release: PV_REL=$(get_version_component_range 1-4) @@ -123,6 +123,26 @@ "${FILESDIR}/flashplugin-lahf-fix.c" \ || die "Compile of flashplugin-lahf-fix.so failed" fi + pushd "${T}" > /dev/null + cat <<-EOF > flashmemcpy.c + #include + void *memcpy(void *dst, const void *src, size_t size) + { + void *orig = dst; + asm volatile("rep ; movsq" + :"=D" (dst), "=S" (src) + :"0" (dst), "1" (src), "c" (size >> 3) + :"memory"); + asm volatile("rep ; movsb" + :"=D" (dst), "=S" (src) + :"0" (dst), "1" (src), "c" (size & 7) + :"memory"); + return orig; + } + EOF + $(tc-getCC) ${CFLAGS} -c flashmemcpy.c || die + $(tc-getLD) $(raw-ldflags) -G flashmemcpy.o -o flashmemcpy.so || die + popd > /dev/null } src_install() { @@ -165,6 +185,9 @@ # The magic config file! insinto "/etc/adobe" doins "${FILESDIR}/mms.cfg" + + exeinto /usr/$(get_libdir)/${PN} + doexe "${T}"/flashmemcpy.so || die } pkg_postinst() { @@ -205,4 +228,9 @@ ewarn "issues. Please consider only running flash applets you know to" ewarn "be safe. The 'flashblock' extension may help for mozilla users:" ewarn " https://addons.mozilla.org/en-US/firefox/addon/433" + + ewarn + ewarn "You need to launch your browser prepending LD_PRELOAD=\"/usr/$(get_libdir)/adobe-flash/flashmemcpy.so\"" + ewarn "in command line for bug 354073 if you experience sound problems with recent glibc." + ewarn }