[MPlayer-dev-eng] [PATCH] Fix crash when using win32 codecs on mac osx / intel

Ulion ulion2002 at gmail.com
Tue Sep 25 15:40:36 CEST 2007


2007/9/25, Diego Biurrun <diego at biurrun.de>:
> On Wed, Aug 29, 2007 at 01:47:00PM +0800, Ulion wrote:
> >
> > I compiled a gcc 4.2.1 on osx intel. And I found that the option
> > -fstackrealign was never existed (searched both in gcc 4.2.1 and 4.2.0
> > sources), only -mstackrealign is there. Also, the miss-third-parameter
> > bug is still there.
> >
> > I re-check the search result of -fstackrealign from google, found the
> > -fstackrealign was original found in
> > http://gcc.gnu.org/gcc-4.2/changes.html , it's an in-correct
> > documenting, should be -mstackrealign.
> >
> > So I update the patch to only check -mstackrealign flag although the
> > previous patch still works in all situations.
> >
> > --- configure (revision 24280)
> > +++ configure (working copy)
> > @@ -1504,6 +1504,28 @@
> >
> > +# Check whether compiler support -mstackrealign flag.
> > +echocheck "cflag stackrealign"
>
> -mstackrealign

Fixed as
+echocheck "cflag -mstackrealign"

> > +cat > $TMPC << EOF
> > +__attribute__((noinline)) static int foo3(int i1, int i2, int i3) {
> > +  return i3;
> > +}
> > +int main() {
>
> main(void) ;)
>
> > +  return foo3(1,2,3)==3 ? 0 : 1;
> > +}
>
> Can you do it all in main or do you have to call a function explicitly?

Have to. That's a check for compile bug of function parameters.

>
> > +EOF
> > +_cflag_stackrealign=
> > +if test "$cc_vendor" = "gnu" ; then
> > +  # Gcc above 4.2 and some earlier svn version support this flag for intel x86.
>
> gcc >4.2, versions

Fixed as
+ # Gcc since 4.2 and ... versions.

>
> > +  cc_check -O4 -mstackrealign && _cflag_stackrealign=-mstackrealign
> > +  if test -n "$_cflag_stackrealign" && ! tmp_run ; then
> > +    # Check the lost-third-parameter bug, try to fix it if we can. Referred in
> > +    # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
> > +    cc_check -O4 $_cflag_stackrealign -fno-unit-at-a-time && tmp_run && _cflag_stackrealign="$_cflag_stackrealign -fno-unit-at-a-time"
>
> Break this long line please.
>

Ok.

> Hmm, IIUC this is only ever relevant on OS X, so you should surround the
> check by "if darwin".
>

Ok, wrapped by "if target os is darwin".



-- 
Ulion
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: macosx_intel_win32dll6.txt
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070925/b55a4079/attachment.txt>


More information about the MPlayer-dev-eng mailing list