Mail archive
alpine-devel

Re: [alpine-devel] force compile flag for musl?

From: Natanael Copa <ncopa_at_alpinelinux.org>
Date: Wed, 25 Oct 2017 21:54:22 +0200

On Wed, 25 Oct 2017 14:17:28 -0500
"A. Wilcox" <awilfox_at_adelielinux.org> wrote:

> On 25/10/17 09:46, Natanael Copa wrote:
> > Hi,
> >
> >
> > I wonder what you think about overriding the -Os compile flag for
> > musl, and hardcode it to -O2.
>
>
> Possibly. Is there some benchmarks available, maybe using libc-test
> or such?
>
>
> > What do you think?
> >
> > + # force -O2 compile flag for better performance +
> > CFLAGS="-O2" \
>
>
> No. Stuff in abuild.conf needs to be preserved and -O2 tacked on the
> end (GCC will only honour last -O flag passed, so this is what you want).
>
> This is INCREDIBLY important to us at Adélie because for instance
> ppc64 BE requires -fno-inline-small-functions due to GCC bug elsewise
> it will cause ABI issues with long double. We also use -march / -mcpu
> which would be discarded here as well, which would cause it to be
> slower on some platforms (-O2 won't help as much on x86_32 as it would
> on -march=pentium4 x86_32, for instance).

Thanks. This is useful information.
 
> I agree with the idea of using -O2 but not with the implementation of
> blowing away all other CFLAGS.

I was thinking about this, yes. I think something like:

  CFLAGS="$CFLAGS -O2"

would be better. Alternatively we could have an optional performance opt, something like:

  CFLAGS="${CFLAGS_OPT_PERFORMACE:-$CFLAGS}"

But I think we just keep it simple as it is, because I measured it and
-O2 was actually slightly slower for the specific use case.

Thanks!

-nc

>
> Best,
> --arw
>



---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Wed Oct 25 2017 - 21:54:22 GMT