Skip to content

Commit ff17780

Browse files
committed
rust: use optimization level s when building for size
In Nick's experience: > z has created larger images than s due to LLVM aggressively > emitting libcalls, regardless of the cost of call setup. > See also commit a75bb4e ("Revert "kbuild: use -Oz > instead of -Os when using clang"). This also aligns it to the C side. Suggested-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 1cbd8a2 commit ff17780

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ KBUILD_CFLAGS += -O3
809809
KBUILD_RUSTFLAGS_OPT_LEVEL_MAP := 3
810810
else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
811811
KBUILD_CFLAGS += -Os
812-
KBUILD_RUSTFLAGS_OPT_LEVEL_MAP := z
812+
KBUILD_RUSTFLAGS_OPT_LEVEL_MAP := s
813813
endif
814814

815815
# Always set `debug-assertions` and `overflow-checks` because their default

0 commit comments

Comments
 (0)