[FFmpeg-devel] [PATCH] swscale: add workaround for building 32 bit shared libs with gcc4.2 on 64 bit Mac OS X

Michael Bradshaw mbradshaw at sorensonmedia.com
Mon Jun 4 18:49:14 CEST 2012


On Sat, Jun 2, 2012 at 8:42 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Fri, Jun 01, 2012 at 02:15:53PM -0600, Michael Bradshaw wrote:
>> Hi,
>>
>> Attached patch allows shared 32 bit ffmpeg to be built with gcc4.2 on
>> 64 bit Mac OS X. Without this, --disable-asm must be passed to
>> configure.
>>
>> I expect this patch will be a bit controversial, and if anyone has a
>> better solution I'd be happy to see it.
>>
>> See discussion here:
>> http://ffmpeg.org/pipermail/ffmpeg-user/2012-May/006851.html (and
>> continued here:
>> http://ffmpeg.org/pipermail/ffmpeg-user/2012-June/006854.html) for
>> more information relating to this.
>
> does replacing some of the problemtic "m" cases by MANGLE() work ?

I'm not exactly sure what the "m" cases are, but I took a shot in the
dark and tried:

@@ -884,7 +884,7 @@ static inline void RENAME(rgb15tobgr24)(const
uint8_t *src, uint8_t *dst, int sr
             "por        %%mm5, %%mm3    \n\t"

             :"=m"(*d)
-            :"m"(*s),"m"(mask15b),"m"(mask15g),"m"(mask15r),"m"(mmx_null),"m"(mul15_mid),"m"(mul15_hi)
+            :"m"(*s),""(MANGLE(mask15b)),""(MANGLE(mask15g)),""(MANGLE(mask15r)),""(MANGLE(mmx_null)),""(MANGLE(mul15_mid)),""(MANGLE(mul15_hi))
             :"memory");
         /* borrowed 32 to 24 */
         __asm__ volatile(


Which just resulted in:

libswscale/x86/rgb2rgb_template.c: In function ‘rgb15tobgr24_MMX’:
libswscale/x86/rgb2rgb_template.c:825: warning: asm operand 2 probably
doesn’t match constraints
libswscale/x86/rgb2rgb_template.c:825: warning: asm operand 3 probably
doesn’t match constraints
libswscale/x86/rgb2rgb_template.c:825: warning: asm operand 4 probably
doesn’t match constraints
libswscale/x86/rgb2rgb_template.c:825: warning: asm operand 5 probably
doesn’t match constraints
libswscale/x86/rgb2rgb_template.c:825: warning: asm operand 6 probably
doesn’t match constraints
libswscale/x86/rgb2rgb_template.c:825: warning: asm operand 7 probably
doesn’t match constraints
libswscale/x86/rgb2rgb_template.c:825: error: impossible constraint in ‘asm’


That's probably not what you meant to try though. If not, I'm going to
need your help in understanding what to try...

Thanks,

Michael


More information about the ffmpeg-devel mailing list