From 30fcef430c59e5884f6765d16fc201c303b2e92c Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sat, 10 Nov 2001 11:23:47 +0000 Subject: [PATCH] Only use -mpreferred-stack-boundary with gcc versions that support it --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7dbf6575f..0fbe91b2e 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 -- 2.25.1