[MPlayer-dev-eng] [PATCH] Suppress unsupported options when building with clang

Alexander Strange astrange at ithinksw.com
Mon Jul 26 10:12:53 CEST 2010


On Jul 26, 2010, at 1:05 AM, Rowan James wrote:

> This patch stops './configure --cc=clang' from generating command lines with options which clang doesn't support.
> 
> Specifically, clang does not support the '-mcpu=', '-falign-loops=', and '-shared-libgcc' options.
> 
> Developed and tested on OS X 10.6 w/ Xcode 3.2, clang SVN (current), gcc-4.2.1 (Apple)
> 
> Effectively removes warnings otherwise generated for each file; gcc (default) ./configure still builds the same.

How about making it use -Qunused-arguments instead? That stops it printing the warning.

Did you check what circumstances -mcpu is used in?

Also, clang has worse problems. The clang integrated as can't compile mplayer asm yet, and configure's defaulting to -O4 enables link-time optimization which breaks everything. Still, that's not a reason to not fix this.

> 
> ===================================================================
> --- configure	(revision 31826)
> +++ configure	(working copy)
> @@ -1505,7 +1505,10 @@
> fi
> 
> if darwin; then
> -  extra_cflags="-mdynamic-no-pic -falign-loops=16 -shared-libgcc $extra_cflags"
> +  extra_cflags="-mdynamic-no-pic $extra_cflags"
> +  if test "$(basename $_cc)" != "clang" ; then
> +    extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
> +  fi
>  _timer=timer-darwin.c
> fi
> 
> @@ -2449,7 +2452,13 @@
>  fi
> fi
> 
> +# -mcpu option isn't supported by clang
> +if test "$(basename $_cc)" = "clang" ; then
> + _mcpu=""
> +fi
> 
> +
> # endian testing
> echocheck "byte order"
> if test "$_big_endian" = auto ; then
> 
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng



More information about the MPlayer-dev-eng mailing list