Skip to content

Commit

Permalink
Makefile: Remove -nostartfiles from LDFLAGS
Browse files Browse the repository at this point in the history
Binutils linker ld does not support the flag -nostartfiles.
This is interpreted as "-n -o startfiles" which fortunately has no impact
on the build process. Removing -nostartfiles has no impact on the build.

Binutils 2.36 and later ld has improved flag parsing and throws an error if
-nostartfiles is passed as an argument. Removing the flag fixes the problem.

Details on the Binutils ML:
https://sourceware.org/pipermail/binutils/2021-June/116826.html

In our ld command line there are explicit
-n -o $(BINDIR)/$(BOOT_NAME).elf options,
hence removing -nostartfiles will not alter the build.

Signed-off-by: Chris Elledge <celledge@digitallumensinc.com>
Reviwed-by: Aubin Constans <aubin.constans@microchip.com>
  • Loading branch information
Chris Elledge authored and ehristev committed Jun 9, 2021
1 parent 7e0717b commit 3207586
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -283,7 +283,7 @@ endif
# --cref: add cross reference to map file
# -lc : tells the linker to tie in newlib
# -lgcc : tells the linker to tie in newlib
LDFLAGS=-nostartfiles -Map=$(BINDIR)/$(BOOT_NAME).map --cref -static
LDFLAGS=-Map=$(BINDIR)/$(BOOT_NAME).map --cref -static
LDFLAGS+=-T $(link_script) $(GC_SECTIONS) -Ttext $(LINK_ADDR)

ifneq ($(DATA_SECTION_ADDR),)
Expand Down

0 comments on commit 3207586

Please sign in to comment.