diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2022-04-24 18:36:10 +0200 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2022-04-24 19:18:57 +0200 |
commit | 7fbfb2050f24a457a909ea6bcec85c49a21db83a (patch) | |
tree | c2b7102fe3c434ea28309e1a0ad93e5b9c12bdd9 | |
parent | 05c366a56095d116f0f8f331f3d494d9580baf33 (diff) | |
download | busybox-w32-7fbfb2050f24a457a909ea6bcec85c49a21db83a.tar.gz busybox-w32-7fbfb2050f24a457a909ea6bcec85c49a21db83a.tar.bz2 busybox-w32-7fbfb2050f24a457a909ea6bcec85c49a21db83a.zip |
kbuild: Prefer -Oz over -Os
-Oz Optimize aggressively for size rather than speed.
with gcc-12 so far (i think only https://gcc.gnu.org/PR32803 and 103773 )
"shorter load imm on x86_64":
(add/remove: 0/0 grow/shrink: 4/1670 up/down: 6/-13196) Total: -13190 bytes
text data bss dec hex filename
975753 4227 1816 981796 efb24 busybox_old
962442 4227 1816 968485 ec725 busybox_unstripped
with clang-15:
(add/remove: 394/34 grow/shrink: 161/1856 up/down: 18644/-98946)Total: -80302 bytes
text data bss dec hex filename
1120994 16066 1696 1138756 116044 busybox_old
1040689 16026 1696 1058411 10266b busybox_unstripped
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r-- | Makefile.flags | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile.flags b/Makefile.flags index c34356230..84cb00a75 100644 --- a/Makefile.flags +++ b/Makefile.flags | |||
@@ -87,14 +87,14 @@ endif | |||
87 | #CFLAGS += $(call cc-option,-Wconversion,) | 87 | #CFLAGS += $(call cc-option,-Wconversion,) |
88 | 88 | ||
89 | ifneq ($(CONFIG_DEBUG),y) | 89 | ifneq ($(CONFIG_DEBUG),y) |
90 | CFLAGS += $(call cc-option,-Os,$(call cc-option,-O2,)) | 90 | CFLAGS += $(call cc-option,-Oz,$(call cc-option,-Os,$(call cc-option,-O2,))) |
91 | else | 91 | else |
92 | CFLAGS += $(call cc-option,-g,) | 92 | CFLAGS += $(call cc-option,-g,) |
93 | #CFLAGS += "-D_FORTIFY_SOURCE=2" | 93 | #CFLAGS += "-D_FORTIFY_SOURCE=2" |
94 | ifeq ($(CONFIG_DEBUG_PESSIMIZE),y) | 94 | ifeq ($(CONFIG_DEBUG_PESSIMIZE),y) |
95 | CFLAGS += $(call cc-option,-O0,) | 95 | CFLAGS += $(call cc-option,-O0,) |
96 | else | 96 | else |
97 | CFLAGS += $(call cc-option,-Os,$(call cc-option,-O2,)) | 97 | CFLAGS += $(call cc-option,-Oz,$(call cc-option,-Os,$(call cc-option,-O2,))) |
98 | endif | 98 | endif |
99 | endif | 99 | endif |
100 | ifeq ($(CONFIG_DEBUG_SANITIZE),y) | 100 | ifeq ($(CONFIG_DEBUG_SANITIZE),y) |