summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEric Andersen2001-11-10 11:23:47 +0000
committerEric Andersen2001-11-10 11:23:47 +0000
commit30fcef430c59e5884f6765d16fc201c303b2e92c (patch)
treec36e2f86cfdd7612c6fe4f792c8fa7f6175ce2cb /Makefile
parentcd8c436d811a5a077a0b61a6616c900173e2dcfb (diff)
downloadbusybox-30fcef430c59e5884f6765d16fc201c303b2e92c.zip
busybox-30fcef430c59e5884f6765d16fc201c303b2e92c.tar.gz
Only use -mpreferred-stack-boundary with gcc versions that support it
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 7dbf657..0fbe91b 100644
--- a/Makefile
+++ b/Makefile
@@ -111,9 +111,11 @@ export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP
# use '-Os' optimization if available, else use -O2
OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null \
>/dev/null 2>&1; then echo "-Os"; else echo "-O2" ; fi}
-
+GCC_STACK_BOUNDRY := ${shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null \
+ >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; else echo "" ; fi}
+OPTIMIZATIONS=$(OPTIMIZATION) -fomit-frame-pointer $(GCC_STACK_BOUNDRY)
WARNINGS=-Wall -Wstrict-prototypes -Wshadow
-CFLAGS = -I $(TOPDIR)/include
+CFLAGS = -I$(TOPDIR)/include
ARFLAGS = -r
#
@@ -147,7 +149,7 @@ ifeq ($(strip $(DODEBUG)),true)
LDFLAGS += -Wl,-warn-common
STRIPCMD =
else
- CFLAGS += $(WARNINGS) $(OPTIMIZATION) -fomit-frame-pointer -mpreferred-stack-boundary=2 -D_GNU_SOURCE
+ CFLAGS += $(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE
LDFLAGS += -s -Wl,-warn-common
STRIPCMD = $(STRIP) --remove-section=.note --remove-section=.comment $(PROG)
endif