From 645045a799bab1705cea533ba471b6ee21d08a36 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 10 Dec 2015 00:49:25 +0200 Subject: [PATCH] py/mkrules.mk: Don't pass COPT to linker. Oftentimes, libc, libm, etc. don't come compiled with CPU compressed code option (Thumb, MIPS16, etc.), but we may still want to use such compressed code for MicroPython itself. --- py/mkrules.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py/mkrules.mk b/py/mkrules.mk index 26afdf227c..9cbef1ac5a 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -81,7 +81,9 @@ all: $(PROG) $(PROG): $(OBJ) $(ECHO) "LINK $@" - $(Q)$(CC) $(COPT) -o $@ $^ $(LIB) $(LDFLAGS) +# Do not pass COPT here - it's *C* compiler optimizations. For example, +# we may want to compile using Thumb, but link with non-Thumb libc. + $(Q)$(CC) -o $@ $^ $(LIB) $(LDFLAGS) ifndef DEBUG $(Q)$(STRIP) $(STRIPFLAGS_EXTRA) $(PROG) endif