aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/at91bootstrap/patches/001-Makefile-Remove-nostartfiles-from-LDFLAGS.patch
blob: 9d48758bdad233eea7217e3b8ae2e9bb165e00f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 59c8963d8e6a08222616d1b384e1009ba05e6b82 Mon Sep 17 00:00:00 2001
From: Chris Elledge <celledge@digitallumensinc.com>
Date: Tue, 8 Jun 2021 14:01:14 -0400
Subject: Makefile: Remove -nostartfiles from LDFLAGS

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>
Reviewed-by: Aubin Constans <aubin.constans@microchip.com>
[eugen.hristev@microchip.com: ported to at91bootstrap4]
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/Makefile
+++ b/Makefile
@@ -275,7 +275,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),)