summaryrefslogtreecommitdiff
path: root/Rules.mak
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-04-14 23:58:41 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-04-14 23:58:41 +0200
commitf820f4ce071ae0985d84e09ea74dc42d55081e86 (patch)
treed1e830cd282aaaceb0a0804bf681137fbf00dedd /Rules.mak
parentcf0234de47b019ac24e2d361d6386fdfad48f119 (diff)
buildsys: pass -O to ld unless DODEBUG
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
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