diff --git a/Marlin/Makefile b/Marlin/Makefile index 03d93845b8..81eeceada9 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -387,6 +387,7 @@ CDEBUG = -g$(DEBUG) CWARN = -Wall -Wstrict-prototypes CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct \ -fshort-enums -w -ffunction-sections -fdata-sections \ + -flto \ -DARDUINO=$(ARDUINO_VERSION) ifneq ($(HARDWARE_MOTHERBOARD),) CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD} @@ -510,7 +511,7 @@ extcoff: $(TARGET).elf # Link: create ELF output file from library. $(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h $(Pecho) " CXX $@" - $P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections -o $@ -L. $(OBJ) $(LDFLAGS) + $P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections,--relax -o $@ -L. $(OBJ) $(LDFLAGS) $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE) $(Pecho) " CC $<"