From 31cd92f1c9869f2ee9c383ea4476ef77a02fe8bd Mon Sep 17 00:00:00 2001 From: WestfW Date: Sun, 8 Jul 2018 19:48:34 -0700 Subject: [PATCH] It turns out that the "-nostdlib" switch that we've been using has been unncessary for quite a long time. It turns out that if we don't call and stdlib functions, then no stdlib bloat gets added (duh.) Thanks to matthijskooijman for finally noticing this. It fixes bugs related to using the EEPROM functions (from stdlib) in spite of library name changes between compiler versions. (Now compiles with gcc 3.4.x though gcc 5.2.x, AFAICT.) https://github.com/Optiboot/optiboot/issues/233 https://github.com/Optiboot/optiboot/issues/177 --- optiboot/bootloaders/optiboot/Makefile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/optiboot/bootloaders/optiboot/Makefile b/optiboot/bootloaders/optiboot/Makefile index 229138a..888d890 100644 --- a/optiboot/bootloaders/optiboot/Makefile +++ b/optiboot/bootloaders/optiboot/Makefile @@ -126,19 +126,12 @@ OPTIMIZE = -Os -fno-split-wide-types -mrelax DEFS = -# -# platforms support EEPROM and large bootloaders need the eeprom functions that -# are defined in libc, even though we explicity remove it with -nostdlib because -# of the space-savings. -LIBS = -lc - CC = $(GCCROOT)avr-gcc # Override is only needed by avr-lib build system. override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) -DF_CPU=$(AVR_FREQ) $(DEFS) -override LDFLAGS = $(LDSECTIONS) -Wl,--relax -nostartfiles -nostdlib -#-Wl,--gc-sections +override LDFLAGS = $(LDSECTIONS) -Wl,--relax -nostartfiles OBJCOPY = $(GCCROOT)avr-objcopy OBJDUMP = $(call fixpath,$(GCCROOT)avr-objdump)