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

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Sep 30 11:16:27 CEST 2007


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.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list