On Tue, Jan 21, 2014 at 09:34:01PM +0200, Martin Storsjö wrote:
> On Tue, 21 Jan 2014, Diego Biurrun wrote:
> 
> >This prevents the default flags from getting clobbered by flags
> >passed to configure on the command line.
> >---
> >
> >This fixes linking doc/print_options on the suncc/linux FATE stations.
> 
> I don't really follow how this patch fixes the issue on those FATE
> instances. Can you outline what happened before and after this
> patch?

Those FATE stations pass --host-cflags=-I/usr/include/i386-linux-gnu which
clobbers the -O3 that appears in hostcflags otherwise.  Without optimization
flags suncc does not eliminate unused inline functions and fails to link due
to some missing symbols referenced from those functions.

After my patch -O3 is always added to hostcflags and suncc eliminates those
symbols, making the link succeed.

> >Now -O3 overrides any other optimization flag passed via --host-cflags
> >to configure, as -O3 will get added to HOSTCFLAGS last.  That's slightly
> >suboptimal, but a really clean solution is rather involved and probably
> >overkill.
> >
> >One would need to handle optimization flags for the host compiler similar
> >to what is done for the target compiler in configure lines 4108ff.  For the
> 
> What lines?

if [ -z "$optflags" ]; then
    if enabled small; then
        optflags=$cflags_size
    elif enabled optimizations; then
        optflags=$cflags_speed
    else
        optflags=$cflags_noopt
    fi
fi

check_optflags(){
    check_cflags "$@"
    enabled lto && check_ldflags "$@"
}


if enabled lto; then
    test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
    check_cflags  -flto
    check_ldflags -flto $cpuflags
fi

check_optflags $optflags
check_optflags -fno-math-errno
check_optflags -fno-signed-zeros

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to