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

Michael Niedermayer michaelni at gmx.at
Mon Jun 4 18:55:40 CEST 2012


On Mon, Jun 04, 2012 at 10:49:14AM -0600, Michael Bradshaw wrote:
> 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...

sure sorry
it should look something like this:

-"foo     %5, bar \n\t"
+"foo  "MANGLE(this)",bar \n\t"
...
-            :"m"(that), "m"(this)
+            :"m"(that)

see the existing code on how MANGLE() is used
also keep in mind that if you remove a "m" (or any other argument)
the numbers used to access the later ones will decrease by 1

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120604/ddb78f48/attachment.asc>


More information about the ffmpeg-devel mailing list