Mail archive

[alpine-devel] force compile flag for musl?

From: Natanael Copa <>
Date: Wed, 25 Oct 2017 16:46:14 +0200


I wonder what you think about overriding the -Os compile flag for musl,
and hardcode it to -O2.

I think this makes sense since the functions in libc are so often used
that we want trade better performance at the cost of slightly bigger

This means that we override whatever user as set CFLAGS to
in /etc/abuild.conf

We already do this with zlib.

What do you think?

diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD
index 1938bbb3ca..193002186d 100644
--- a/main/musl/APKBUILD
+++ b/main/musl/APKBUILD
_at_@ -54,6 +54,8 @@ build() {
        # note: not autotools
+ # force -O2 compile flag for better performance
+ CFLAGS="-O2" \
        LDFLAGS="$LDFLAGS -Wl,-soname,libc.musl-${CARCH}.so.1" \
        ./configure \
                --build=$CBUILD \


Received on Wed Oct 25 2017 - 16:46:14 UTC