[FFmpeg-devel] [PATCH] add cflags filtering rules for suncc

Måns Rullgård mans
Mon Nov 2 12:14:11 CET 2009


Michael Kostylev <michael.kostylev at gmail.com> writes:

> On Sat Oct 31 20:11:16 2009
> M?ns Rullg?rd wrote:
>
>>>> The bugs should be tracked down and fixed or worked around.  Disabling
>>>> optimisations is a bad idea (except for the gcc vectoriser, which will
>>>> never be of any use).
>>>
>>> I thought that O2 is better than nothing and slightly better than O1.
>>> Currently, non-working O3 requires some hackery with the options like 
>>> --disable-optimizations --extra-cflags='-O2 -xregs=frameptr' or
>>> --enable-small --disable-optimizations --extra-cflags='-O2 -xspace -xregs=frameptr'
>> 
>> But _why_ does -O[1-5] not work?  We should make sure the bug isn't in
>> our code.
>
> After all, libpostproc is an option, so it is safe enough to use -O5 
> by default.
>
> Michael
>
> --- ./configure.orig
> +++ ./configure
> @@ -1619,6 +1619,37 @@
>      cc_version="AV_STRINGIFY(__SUNPRO_C)"
>      DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
>      DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
> +    filter_cflags=suncc_flags
> +    suncc_flags(){
> +        for flag; do
> +            case $flag in
> +                -march=*|-mcpu=*)
> +                    case "${flag#*=}" in
> +                        native)                            echo -xtarget=native     ;;

We don't pass "native" directly to the compiler so it doesn't need to
be handled here.  Including it for completeness doesn't hurt though.

> +                        v9)                                echo -xarch=sparc        ;;

Isn't it better to use -xtarget here?  That option takes more detailed
chip names and sets -xarch appropriately.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list