i386: make stack size optimization selectable, and allow i486 insns (bswap)
[oweals/busybox.git] / arch / i386 / Makefile
index 385dd52beefc1c31596b4b4e6c33a160cd6dda47..425361fd9b51eefc2334ca0ec8a6ddbc344be987 100644 (file)
@@ -2,4 +2,12 @@
 # Build system
 # ==========================================================================
 
-CFLAGS += $(call cc-option,-march=i386 -mpreferred-stack-boundary=2,)
+# 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,-mpreferred-stack-boundary=2,)
+endif