← Commit list

2c9970281

Denys Vlasenko
Denys Vlasenko
2018-04-06
SUCCESS Duration: 141s

Subject

i386: make stack size optimization selectable, and allow i486 insns (bswap)

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

Config.in+8 -0
@@ -518,6 +518,14 @@ config USE_PORTABLE_CODE
compiler other than gcc.
If you do use gcc, this option may needlessly increase code size.
+config STACK_OPTIMIZATION_386
+ bool "Use -mpreferred-stack-boundary=2 on i386 arch"
+ default y
+ help
+ This option makes for smaller code, but some libc versions
+ do not work with it (they use SSE instructions without
+ ensuring stack alignment).
+
comment 'Installation Options ("make install" behavior)'
choice
arch/i386/Makefile+7 -1
@@ -2,6 +2,12 @@
# Build system
# ==========================================================================
+# Allow i486 insns (basically, bswap insn)
+# Do not try to tune for 486+ (might add padding)
+CFLAGS += $(call cc-option,-march=i486 -mtune=i386,)
+
+ifeq ($(CONFIG_STACK_OPTIMIZATION_386),y)
# -mpreferred-stack-boundary=2 is essential in preventing gcc 4.2.x
# from aligning stack to 16 bytes. (Which is gcc's way of supporting SSE).
-CFLAGS += $(call cc-option,-march=i386 -mpreferred-stack-boundary=2,)
+CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2,)
+endif