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

Ulion ulion2002 at gmail.com
Sun Sep 30 11:56:41 CEST 2007


2007/9/30, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> Hello,
> On Sat, Sep 29, 2007 at 10:53:25PM +0200, Diego Biurrun wrote:
> > On Sat, Sep 29, 2007 at 10:47:23PM +0200, Diego Biurrun wrote:
> [...]
> > +if linux && test "$cc_vendor" = "gnu" ; then
> > +echocheck "GCC support of -mstackrealign"
> > +# GCC 4.2 and some earlier Apple versions support this flag on x86. It is
> > +# needed to avoid crashes when loading Win32 DLLs on Mac OS X / Intel, see
> > +# http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
>
> This is not quite right, -mstackrealign is needed due to the different
> ABI OSX/Intel has from windows, but the check for this is trivial.
>
> > +cat > $TMPC << EOF
> > +__attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
> > +int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
>
> What this test actually is for (and what is described in the blog) is the compiler creating
> completely wrong and idiotic code, which can be worked around with -fno-unit-at-a-time.
> The only reason we even consider this is that Apple never seems to
> consider a working compiler important and leaves them unfixed for ages -
> even though this bug affects even trivial C code.
>

How about this comment:

# GCC 4.2 and some earlier Apple versions support this flag on x86. It is needed
# due to the different ABI OSX/Intel has from windows. But the current gcc will
# create wrong code with this flag which described in the blog
# http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
# This problem can be worked around by adding cflag -fno-unit-at-a-time.
# Now we are trying to find the correct way to use this flag.

-- 
Ulion



More information about the MPlayer-dev-eng mailing list