summaryrefslogtreecommitdiff
path: root/Rules.mak
diff options
context:
space:
mode:
Diffstat (limited to 'Rules.mak')
-rw-r--r--Rules.mak6
1 files changed, 5 insertions, 1 deletions
diff --git a/Rules.mak b/Rules.mak
index c68153e36..83d78ff28 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -687,14 +687,18 @@ LDFLAGS_NOSTRIP += $(CFLAG_-Wl--hash-style=gnu)
endif
endif
-LDFLAGS:=$(LDFLAGS_NOSTRIP) -Wl,-z,defs
ifeq ($(DODEBUG),y)
CFLAGS += -O0 -g3 -DDEBUG
else
CFLAGS += $(OPTIMIZATION)
CFLAGS += $(OPTIMIZATION-$(GCC_MAJOR_VER))
CFLAGS += $(OPTIMIZATION-$(GCC_MAJOR_VER).$(GCC_MINOR_VER))
+$(eval $(call check-ld-var,-O2))
+LDFLAGS_NOSTRIP += $(CFLAG_-Wl-O2)
endif
+
+LDFLAGS:=$(LDFLAGS_NOSTRIP) -Wl,-z,defs
+
ifeq ($(DOSTRIP),y)
LDFLAGS += -Wl,-s
else