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

Diego Biurrun diego at biurrun.de
Tue Sep 25 10:00:18 CEST 2007


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
> +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?

> +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

> +  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.

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

Diego



More information about the MPlayer-dev-eng mailing list