diff options
-rw-r--r-- | Config.in | 8 | ||||
-rw-r--r-- | arch/i386/Makefile | 8 |
2 files changed, 15 insertions, 1 deletions
@@ -518,6 +518,14 @@ config USE_PORTABLE_CODE | |||
518 | compiler other than gcc. | 518 | compiler other than gcc. |
519 | If you do use gcc, this option may needlessly increase code size. | 519 | If you do use gcc, this option may needlessly increase code size. |
520 | 520 | ||
521 | config STACK_OPTIMIZATION_386 | ||
522 | bool "Use -mpreferred-stack-boundary=2 on i386 arch" | ||
523 | default y | ||
524 | help | ||
525 | This option makes for smaller code, but some libc versions | ||
526 | do not work with it (they use SSE instructions without | ||
527 | ensuring stack alignment). | ||
528 | |||
521 | comment 'Installation Options ("make install" behavior)' | 529 | comment 'Installation Options ("make install" behavior)' |
522 | 530 | ||
523 | choice | 531 | choice |
diff --git a/arch/i386/Makefile b/arch/i386/Makefile index e6c99c67d..425361fd9 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile | |||
@@ -2,6 +2,12 @@ | |||
2 | # Build system | 2 | # Build system |
3 | # ========================================================================== | 3 | # ========================================================================== |
4 | 4 | ||
5 | # Allow i486 insns (basically, bswap insn) | ||
6 | # Do not try to tune for 486+ (might add padding) | ||
7 | CFLAGS += $(call cc-option,-march=i486 -mtune=i386,) | ||
8 | |||
9 | ifeq ($(CONFIG_STACK_OPTIMIZATION_386),y) | ||
5 | # -mpreferred-stack-boundary=2 is essential in preventing gcc 4.2.x | 10 | # -mpreferred-stack-boundary=2 is essential in preventing gcc 4.2.x |
6 | # from aligning stack to 16 bytes. (Which is gcc's way of supporting SSE). | 11 | # from aligning stack to 16 bytes. (Which is gcc's way of supporting SSE). |
7 | CFLAGS += $(call cc-option,-march=i386 -mpreferred-stack-boundary=2,) | 12 | CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2,) |
13 | endif | ||