summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-06-17 02:38:20 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-06-17 02:38:20 +0300
commitdf453f0652abbd96310d768ab4529286a76d9775 (patch)
tree7dd11b33a69405cae5c4be4bedeb23b4ead51226
parent332545baa360a4f562b6543233aebc02fd65029f (diff)
downloadmicropython-df453f0652abbd96310d768ab4529286a76d9775.tar.gz
micropython-df453f0652abbd96310d768ab4529286a76d9775.zip
unix: Time to build with --gc-sections.
This actually saves "only" 6K for x86_64 build, as we're still more or less careful to #ifdef unneeded code. But relying on --gc-sections in a "lazy" manner would allow to make #ifdef'ing less pervasive (not suggested right away, but an option for the future).
-rw-r--r--unix/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/unix/Makefile b/unix/Makefile
index 566c7a372b..37c7f6e844 100644
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -28,7 +28,7 @@ ifdef DEBUG
CFLAGS += -g
COPT = -O0
else
-COPT = -Os #-DNDEBUG
+COPT = -Os -fdata-sections -ffunction-sections #-DNDEBUG
# _FORTIFY_SOURCE is a feature in gcc/glibc which is intended to provide extra
# security for detecting buffer overflows. Some distros (Ubuntu at the very least)
# have it enabled by default.
@@ -68,7 +68,7 @@ else
# Use gcc syntax for map file
LDFLAGS_ARCH = -Wl,-Map=$@.map,--cref
endif
-LDFLAGS = $(LDFLAGS_MOD) $(LDFLAGS_ARCH) -lm $(LDFLAGS_EXTRA)
+LDFLAGS = $(LDFLAGS_MOD) $(LDFLAGS_ARCH) -lm $(LDFLAGS_EXTRA) -Wl,--gc-sections
ifeq ($(MICROPY_FORCE_32BIT),1)
# Note: you may need to install i386 versions of dependency packages,