Browse Source

reduce binary size of .hex

still a few bytes bigger than with arduino but nothing major
Markus Towara 7 years ago
parent
commit
23a675f621
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      Marlin/Makefile

+ 2
- 1
Marlin/Makefile View File

387
 CWARN = -Wall -Wstrict-prototypes
387
 CWARN = -Wall -Wstrict-prototypes
388
 CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct \
388
 CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct \
389
 	-fshort-enums -w -ffunction-sections -fdata-sections \
389
 	-fshort-enums -w -ffunction-sections -fdata-sections \
390
+	-flto \
390
 	-DARDUINO=$(ARDUINO_VERSION)
391
 	-DARDUINO=$(ARDUINO_VERSION)
391
 ifneq ($(HARDWARE_MOTHERBOARD),)
392
 ifneq ($(HARDWARE_MOTHERBOARD),)
392
 CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
393
 CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
510
 	# Link: create ELF output file from library.
511
 	# Link: create ELF output file from library.
511
 $(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
512
 $(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
512
 	$(Pecho) "  CXX   $@"
513
 	$(Pecho) "  CXX   $@"
513
-	$P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections -o $@ -L. $(OBJ) $(LDFLAGS)
514
+	$P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections,--relax -o $@ -L. $(OBJ) $(LDFLAGS)
514
 
515
 
515
 $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
516
 $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
516
 	$(Pecho) "  CC    $<"
517
 	$(Pecho) "  CC    $<"

Loading…
Cancel
Save