Skip to content

Commit 9f2a8a0

Browse files
committed
Pass -O3 and -O2 (optimize for speed) to -Os (Optimize for space)
Adresses @easrentai suggestion to pass modules build optimization for space here: #590 (comment) - Uniformized module's $(CROSS_TOOLS) being passed as environment variable, prior of ./configure call
1 parent 96a20a7 commit 9f2a8a0

File tree

25 files changed

+56
-19
lines changed

25 files changed

+56
-19
lines changed

modules/busybox

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ busybox_configure := $(MAKE) CC="$(heads_cc)" oldconfig
1212
busybox_config := config/busybox.config
1313
busybox_output := busybox
1414
busybox_target := \
15+
HOSTCXXFLAGS="-Os" \
1516
$(CROSS_TOOLS) \
1617
$(MAKE_JOBS) \
1718

modules/cairo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ cairo_url := https://www.cairographics.org/releases/$(cairo_tar)
77
cairo_hash := 8c90f00c500b2299c0a323dd9beead2a00353752b2092ead558139bd67f7bf16
88

99
cairo_configure := \
10+
CFLAGS="-DCAIRO_NO_MUTEX=1 -Os" \
1011
$(CROSS_TOOLS) \
11-
CFLAGS="-DCAIRO_NO_MUTEX=1 -O3" \
1212
./configure \
1313
--host $(MUSL_ARCH)-elf-linux \
1414
--prefix="/" \

modules/cryptsetup

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ cryptsetup_hash := af2b04e8475cf40b8d9ffd97a1acfa73aa787c890430afd89804fb544d6ad
1010

1111
# Use an empty prefix so that the executables will not include the
1212
# build path.
13-
cryptsetup_configure := ./configure \
13+
cryptsetup_configure := \
1414
$(CROSS_TOOLS) \
15+
CFLAGS="-Os" \
16+
./configure \
1517
--host $(MUSL_ARCH)-elf-linux \
1618
--prefix "/" \
1719
--disable-gcrypt-pbkdf2 \

modules/cryptsetup2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ cryptsetup2_hash := 3bca4ffe39e2f94cef50f6ea65acb873a6dbce5db34fc6bcefe38b6d095e
1010

1111
# Use an empty prefix so that the executables will not include the
1212
# build path.
13-
cryptsetup2_configure := ./configure \
13+
cryptsetup2_configure := \
1414
$(CROSS_TOOLS) \
15+
CFLAGS="-Os" \
16+
./configure \
1517
--host $(MUSL_ARCH)-elf-linux \
1618
--prefix "/" \
1719
--disable-rpath \

modules/flashtools

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ flashtools_hash := 81b3c1f12318bd2942b426a99638e23d24e85819227653cd3b9302fbfc43b
1010

1111
flashtools_target := \
1212
$(CROSS_TOOLS) \
13-
CFLAGS="-I$(INSTALL)/include" \
13+
CFLAGS="-Os -I$(INSTALL)/include" \
1414
LDFLAGS="-L$(INSTALL)/lib" \
1515

1616
flashtools_output := \

modules/gpg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ gpg_hash := 6b47a3100c857dcab3c60e6152e56a997f2c7862c1b8b2b25adf3884a1ae2276
1717
# Force a different host/build setting so that it detects a cross compile.
1818
# Otherwise it wil try to run tests.
1919
#
20-
gpg_configure := ./configure \
20+
gpg_configure := \
21+
CFLAGS="-Os" \
2122
$(CROSS_TOOLS) \
23+
./configure \
2224
--build $(MUSL_ARCH)-elf-linux \
2325
--host $(MUSL_ARCH)-linux-musl \
2426
--with-libusb="$(INSTALL)" \

modules/gpg2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ gpg2_hash := 61e83278fb5fa7336658a8b73ab26f379d41275bb1c7c6e694dd9f9a6e8e76ec
1111
# be generated with the correct paths, but then re-write them when
1212
# we use the install target so that they will be copied to the correct
1313
# location.
14-
gpg2_configure := ./configure \
14+
gpg2_configure := \
1515
$(CROSS_TOOLS) \
16+
CFLAGS="-Os" \
17+
./configure \
1618
CPPFLAGS="-I$(INSTALL)/include/libusb-1.0" \
1719
--host $(MUSL_ARCH)-linux-musl \
1820
--with-libusb="$(INSTALL)" \

modules/kexec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ kexec_tar := kexec-tools-$(kexec_version).tar.gz
66
kexec_url := https://kernel.org/pub/linux/utils/kernel/kexec/$(kexec_tar)
77
kexec_hash := 40623d4321be2865ef9ea2cd6ec998d31dcf93d0f74353cbd3aa06d8821e3e41
88

9-
kexec_configure := ./configure \
9+
kexec_configure := \
10+
CFLAGS="-g -Os -fno-strict-aliasing -Wall -Wstrict-prototypes" \
11+
./configure \
1012
$(CROSS_TOOLS) \
1113
--host $(MUSL_ARCH)-elf-linux \
1214
--target $(MUSL_ARCH) \

modules/libassuan

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ libassuan_tar := libassuan-$(libassuan_version).tar.bz2
66
libassuan_url := https://gnupg.org/ftp/gcrypt/libassuan/$(libassuan_tar)
77
libassuan_hash := 91bcb0403866b4e7c4bc1cc52ed4c364a9b5414b3994f718c70303f7f765e702
88

9-
libassuan_configure := ./configure \
9+
libassuan_configure := \
10+
CFLAGS="-Os" \
1011
$(CROSS_TOOLS) \
12+
./configure \
1113
--host $(MUSL_ARCH)-linux-musl \
1214
--prefix "/" \
1315
--disable-static \

modules/libgcrypt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ libgcrypt_tar := libgcrypt-$(libgcrypt_version).tar.bz2
66
libgcrypt_url := https://gnupg.org/ftp/gcrypt/libgcrypt/$(libgcrypt_tar)
77
libgcrypt_hash := 0cba2700617b99fc33864a0c16b1fa7fdf9781d9ed3509f5d767178e5fd7b975
88

9-
libgcrypt_configure := ./configure \
9+
libgcrypt_configure := \
1010
$(CROSS_TOOLS) \
11+
CFLAGS="-Os" \
12+
./configure \
1113
--host=$(MUSL_ARCH)-linux-musl \
1214
--prefix "/" \
1315
--disable-static \

0 commit comments

Comments
 (0)