Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 42074 Details for
Bug 67947
ffmpeg: fix to enable fPIC on x86, allowing the filter to be removed.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixes -fPIC compilation problems - third time lucky :)
ffmpeg-0.4.9_pre1-x86-pic.patch (text/plain), 9.44 KB, created by
Kevin F. Quinn (RETIRED)
on 2004-10-17 16:35:41 UTC
(
hide
)
Description:
Fixes -fPIC compilation problems - third time lucky :)
Filename:
MIME Type:
Creator:
Kevin F. Quinn (RETIRED)
Created:
2004-10-17 16:35:41 UTC
Size:
9.44 KB
patch
obsolete
>Only in work/ffmpeg-0.4.9-pre1/libavcodec/i386: .mpegvideo_mmx_template.c.swp >diff -ur work.orig/ffmpeg-0.4.9-pre1/libavcodec/i386/dsputil_mmx.c work/ffmpeg-0.4.9-pre1/libavcodec/i386/dsputil_mmx.c >--- work.orig/ffmpeg-0.4.9-pre1/libavcodec/i386/dsputil_mmx.c 2004-10-17 21:00:27.678764888 +0200 >+++ work/ffmpeg-0.4.9-pre1/libavcodec/i386/dsputil_mmx.c 2004-10-18 00:09:42.289601664 +0200 >@@ -57,7 +57,7 @@ > "pcmpeqd %%" #regd ", %%" #regd " \n\t"\ > "paddb %%" #regd ", %%" #regd " \n\t" ::) > >-#ifndef PIC >+#ifndef __PIC__ > #define MOVQ_BONE(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_bone)) > #define MOVQ_WTWO(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_wtwo)) > #else >diff -ur work.orig/ffmpeg-0.4.9-pre1/libavcodec/i386/dsputil_mmx_rnd.h work/ffmpeg-0.4.9-pre1/libavcodec/i386/dsputil_mmx_rnd.h >--- work.orig/ffmpeg-0.4.9-pre1/libavcodec/i386/dsputil_mmx_rnd.h 2004-10-17 21:00:20.911793624 +0200 >+++ work/ffmpeg-0.4.9-pre1/libavcodec/i386/dsputil_mmx_rnd.h 2004-10-18 00:09:42.291601360 +0200 >@@ -96,7 +96,7 @@ > "addl %5, %3 \n\t" > "subl $4, %0 \n\t" > "jnz 1b \n\t" >-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used >+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used > :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst) > #else > :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst) >@@ -191,7 +191,7 @@ > "addl $32, %2 \n\t" > "subl $2, %0 \n\t" > "jnz 1b \n\t" >-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used >+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used > :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst) > #else > :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst) >diff -ur work.orig/ffmpeg-0.4.9-pre1/libavcodec/i386/mpegvideo_mmx_template.c work/ffmpeg-0.4.9-pre1/libavcodec/i386/mpegvideo_mmx_template.c >--- work.orig/ffmpeg-0.4.9-pre1/libavcodec/i386/mpegvideo_mmx_template.c 2004-07-06 14:27:36.000000000 +0200 >+++ work/ffmpeg-0.4.9-pre1/libavcodec/i386/mpegvideo_mmx_template.c 2004-10-18 00:43:21.677608024 +0200 >@@ -94,9 +94,23 @@ > SPREADW(%%mm3) > "pxor %%mm7, %%mm7 \n\t" // 0 > "pxor %%mm4, %%mm4 \n\t" // 0 >+#ifdef __PIC__ >+ "movq (%1), %%mm5 \n\t" // qmat[0] >+#else > "movq (%2), %%mm5 \n\t" // qmat[0] >+#endif > "pxor %%mm6, %%mm6 \n\t" >+#ifdef __PIC__ >+ "psubw (%2), %%mm6 \n\t" // -bias[0] >+#else > "psubw (%3), %%mm6 \n\t" // -bias[0] >+#endif >+#ifdef __PIC__ >+ : "+a" (last_non_zero_p1) >+ : "r" (qmat), "r" (bias) >+ ); >+ asm volatile( >+#endif > "movl $-128, %%eax \n\t" > ".balign 16 \n\t" > "1: \n\t" >@@ -110,9 +124,17 @@ > "por %%mm0, %%mm4 \n\t" > "pxor %%mm1, %%mm0 \n\t" > "psubw %%mm1, %%mm0 \n\t" // out=((ABS(block[i])*qmat[0] - bias[0]*qmat[0])>>16)*sign(block[i]) >+#ifdef __PIC__ >+ "movq %%mm0, (%3, %%eax) \n\t" >+#else > "movq %%mm0, (%5, %%eax) \n\t" >+#endif > "pcmpeqw %%mm7, %%mm0 \n\t" // out==0 ? 0xFF : 0x00 >+#ifdef __PIC__ >+ "movq (%2, %%eax), %%mm1 \n\t" >+#else > "movq (%4, %%eax), %%mm1 \n\t" >+#endif > "movq %%mm7, (%1, %%eax) \n\t" // 0 > "pandn %%mm1, %%mm0 \n\t" > PMAXW(%%mm0, %%mm3) >@@ -126,11 +148,19 @@ > PMAXW(%%mm0, %%mm3) > "movd %%mm3, %%eax \n\t" > "movzbl %%al, %%eax \n\t" // last_non_zero_p1 >+#ifdef __PIC__ >+ : "+a" (last_non_zero_p1) >+ : "r" (block+64), >+ "r" (inv_zigzag_direct16+64), "r" (temp_block+64) >+#else > : "+a" (last_non_zero_p1) > : "r" (block+64), "r" (qmat), "r" (bias), > "r" (inv_zigzag_direct16+64), "r" (temp_block+64) >+#endif > ); > // note the asm is split cuz gcc doesnt like that many operands ... >+ // note even more splitting up above when __PIC__ - we're one operand down >+ // on X86 with __PIC__ compared to normal. > asm volatile( > "movd %1, %%mm1 \n\t" // max_qcoeff > SPREADW(%%mm1) >@@ -142,6 +172,10 @@ > ); > }else{ // FMT_H263 > asm volatile( >+#ifdef __PIC__ >+ "pushl %%ebx \n\t" >+ "movl %5, %%ebx \n\t" >+#endif > "movd %%eax, %%mm3 \n\t" // last_non_zero_p1 > SPREADW(%%mm3) > "pxor %%mm7, %%mm7 \n\t" // 0 >@@ -161,7 +195,11 @@ > "por %%mm0, %%mm4 \n\t" > "pxor %%mm1, %%mm0 \n\t" > "psubw %%mm1, %%mm0 \n\t" // out=((ABS(block[i])*qmat[0] - bias[0]*qmat[0])>>16)*sign(block[i]) >+#ifdef __PIC__ >+ "movq %%mm0, (%%ebx, %%eax) \n\t" >+#else > "movq %%mm0, (%5, %%eax) \n\t" >+#endif > "pcmpeqw %%mm7, %%mm0 \n\t" // out==0 ? 0xFF : 0x00 > "movq (%4, %%eax), %%mm1 \n\t" > "movq %%mm7, (%1, %%eax) \n\t" // 0 >@@ -177,9 +215,15 @@ > PMAXW(%%mm0, %%mm3) > "movd %%mm3, %%eax \n\t" > "movzbl %%al, %%eax \n\t" // last_non_zero_p1 >+#ifdef __PIC__ >+ : "+a" (last_non_zero_p1) >+ : "r" (block+64), "r" (qmat+64), "r" (bias+64), >+ "r" (inv_zigzag_direct16+64), "m" (temp_block+64) >+#else > : "+a" (last_non_zero_p1) > : "r" (block+64), "r" (qmat+64), "r" (bias+64), > "r" (inv_zigzag_direct16+64), "r" (temp_block+64) >+#endif > ); > // note the asm is split cuz gcc doesnt like that many operands ... > asm volatile( >diff -ur work.orig/ffmpeg-0.4.9-pre1/libavcodec/libpostproc/postprocess_template.c work/ffmpeg-0.4.9-pre1/libavcodec/libpostproc/postprocess_template.c >--- work.orig/ffmpeg-0.4.9-pre1/libavcodec/libpostproc/postprocess_template.c 2004-05-30 03:53:43.000000000 +0200 >+++ work/ffmpeg-0.4.9-pre1/libavcodec/libpostproc/postprocess_template.c 2004-10-18 00:09:42.295600752 +0200 >@@ -3167,10 +3167,18 @@ > { > #ifdef HAVE_MMX > asm volatile( >+#ifdef __PIC__ >+ "pushl %%ebx \n\t" >+ "movl %5, %%ebx \n\t" >+#endif > "movq (%%eax), %%mm2 \n\t" // packedYOffset > "movq 8(%%eax), %%mm3 \n\t" // packedYScale > "leal (%2,%4), %%eax \n\t" >+#ifdef __PIC__ >+ "leal (%3,%%ebx), %%edx \n\t" >+#else > "leal (%3,%5), %%edx \n\t" >+#endif > "pxor %%mm4, %%mm4 \n\t" > #ifdef HAVE_MMX2 > #define SCALED_CPY(src1, src2, dst1, dst2) \ >@@ -3223,13 +3231,22 @@ > "movq %%mm1, " #dst2 " \n\t"\ > > #endif //!HAVE_MMX2 >- >+#ifdef __PIC__ >+SCALED_CPY((%2) , (%2, %4) , (%3) , (%3, %%ebx)) >+SCALED_CPY((%2, %4, 2), (%%eax, %4, 2), (%3, %%ebx, 2), (%%edx, %%ebx, 2)) >+SCALED_CPY((%2, %4, 4), (%%eax, %4, 4), (%3, %%ebx, 4), (%%edx, %%ebx, 4)) >+ "leal (%%eax,%4,4), %%eax \n\t" >+ "leal (%%edx,%%ebx,4), %%edx \n\t" >+SCALED_CPY((%%eax, %4), (%%eax, %4, 2), (%%edx, %%ebx), (%%edx, %%ebx, 2)) >+ "popl %%ebx \n\t" >+#else > SCALED_CPY((%2) , (%2, %4) , (%3) , (%3, %5)) > SCALED_CPY((%2, %4, 2), (%%eax, %4, 2), (%3, %5, 2), (%%edx, %5, 2)) > SCALED_CPY((%2, %4, 4), (%%eax, %4, 4), (%3, %5, 4), (%%edx, %5, 4)) > "leal (%%eax,%4,4), %%eax \n\t" > "leal (%%edx,%5,4), %%edx \n\t" > SCALED_CPY((%%eax, %4), (%%eax, %4, 2), (%%edx, %5), (%%edx, %5, 2)) >+#endif > > > : "=&a" (packedOffsetAndScale) >@@ -3237,7 +3254,11 @@ > "r"(src), > "r"(dst), > "r" (srcStride), >+#ifdef __PIC__ >+ "m" (dstStride) >+#else > "r" (dstStride) >+#endif > : "%edx" > ); > #else >@@ -3250,8 +3271,16 @@ > { > #ifdef HAVE_MMX > asm volatile( >+#ifdef __PIC__ >+ "pushl %%ebx \n\t" >+ "movl %3, %%ebx \n\t" >+#endif > "leal (%0,%2), %%eax \n\t" >+#ifdef __PIC__ >+ "leal (%1,%%ebx), %%edx \n\t" >+#else > "leal (%1,%3), %%edx \n\t" >+#endif > > #define SIMPLE_CPY(src1, src2, dst1, dst2) \ > "movq " #src1 ", %%mm0 \n\t"\ >@@ -3259,17 +3288,31 @@ > "movq %%mm0, " #dst1 " \n\t"\ > "movq %%mm1, " #dst2 " \n\t"\ > >+#ifdef __PIC__ >+SIMPLE_CPY((%0) , (%0, %2) , (%1) , (%1, %%ebx)) >+SIMPLE_CPY((%0, %2, 2), (%%eax, %2, 2), (%1, %%ebx, 2), (%%edx, %%ebx, 2)) >+SIMPLE_CPY((%0, %2, 4), (%%eax, %2, 4), (%1, %%ebx, 4), (%%edx, %%ebx, 4)) >+ "leal (%%eax,%2,4), %%eax \n\t" >+ "leal (%%edx,%%ebx,4), %%edx \n\t" >+SIMPLE_CPY((%%eax, %2), (%%eax, %2, 2), (%%edx, %%ebx), (%%edx, %%ebx, 2)) >+ "popl %%ebx \n\t" >+#else > SIMPLE_CPY((%0) , (%0, %2) , (%1) , (%1, %3)) > SIMPLE_CPY((%0, %2, 2), (%%eax, %2, 2), (%1, %3, 2), (%%edx, %3, 2)) > SIMPLE_CPY((%0, %2, 4), (%%eax, %2, 4), (%1, %3, 4), (%%edx, %3, 4)) > "leal (%%eax,%2,4), %%eax \n\t" > "leal (%%edx,%3,4), %%edx \n\t" > SIMPLE_CPY((%%eax, %2), (%%eax, %2, 2), (%%edx, %3), (%%edx, %3, 2)) >+#endif > > : : "r" (src), > "r" (dst), > "r" (srcStride), >+#ifdef __PIC__ >+ "m" (dstStride) >+#else > "r" (dstStride) >+#endif > : "%eax", "%edx" > ); > #else >diff -ur work.orig/ffmpeg-0.4.9-pre1/libavcodec/msmpeg4.c work/ffmpeg-0.4.9-pre1/libavcodec/msmpeg4.c >--- work.orig/ffmpeg-0.4.9-pre1/libavcodec/msmpeg4.c 2004-05-25 20:07:24.000000000 +0200 >+++ work/ffmpeg-0.4.9-pre1/libavcodec/msmpeg4.c 2004-10-18 00:09:42.298600296 +0200 >@@ -716,7 +716,7 @@ > necessitate to modify mpegvideo.c. The problem comes from the > fact they decided to store the quantized DC (which would lead > to problems if Q could vary !) */ >-#if defined ARCH_X86 && !defined PIC >+#if defined ARCH_X86 && !defined __PIC__ > asm volatile( > "movl %3, %%eax \n\t" > "shrl $1, %%eax \n\t"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 67947
:
42071
|
42072
|
42074
|
52440
|
52485