[git commit] build system: combat gcc zealotry in data alignment
Denys Vlasenko
vda.linux at googlemail.com
Mon Dec 14 04:53:45 UTC 2020
commit: https://git.busybox.net/busybox/commit/?id=db793480cb8ec3e5f878d1ec18b6ed5010c85e85
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master
text data bss dec hex filename
1020934 559 5052 1026545 fa9f1 busybox_old
1020750 559 5052 1026361 fa939 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
arch/i386/Makefile | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/i386/Makefile b/arch/i386/Makefile
index 425361fd9..2fa008fa7 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -11,3 +11,11 @@ ifeq ($(CONFIG_STACK_OPTIMIZATION_386),y)
# from aligning stack to 16 bytes. (Which is gcc's way of supporting SSE).
CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2,)
endif
+
+# "Control how GCC aligns variables.
+# Supported values for type are compat uses increased alignment value
+# compatible uses GCC 4.8 and earlier, abi uses alignment value as specified by the psABI,
+# and cacheline uses increased alignment value to match the cache line size.
+# compat is the default."
+# "abi" seems to be somewhat successful in preventing oversealous data alignment.
+CFLAGS += $(call cc-option,-malign-data=abi,)
More information about the busybox-cvs
mailing list