summaryrefslogtreecommitdiffstats
path: root/src/target/firmware
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2023-11-22 14:07:36 +0100
committerHarald Welte <laforge@osmocom.org>2023-11-22 14:12:26 +0100
commit818133cd23b493da472daff2cda9a8e97d0c9637 (patch)
tree95aab419f25c7ef8f8e7d7631ba885728a49dcb0 /src/target/firmware
parent7c60c5d6d95a059a50c85b68a5128c5cfd55f04c (diff)
firmware: -nostartfiles -nodefaultlibs are not flags of LD but flags of GCC
It seems that those flags have always been gcc flags, and not ld flags. After decades of tolerating this, binutils 2.36.x no longer tolerates those flags but prints an error: arm-none-eabi-ld: Error: unable to disambiguate: -nostartfiles (did you mean --nostartfiles ?) See also https://github.com/apache/nuttx/issues/3826 and the related https://github.com/apache/nuttx/pull/3836 how this was solved in another project - I adopted that solution here 1:1 Change-Id: Id199e4d03d5aae07a347c98f47791f42c12008c6
Diffstat (limited to 'src/target/firmware')
-rw-r--r--src/target/firmware/Makefile.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/target/firmware/Makefile.inc b/src/target/firmware/Makefile.inc
index 2be240d2..86e8f3ce 100644
--- a/src/target/firmware/Makefile.inc
+++ b/src/target/firmware/Makefile.inc
@@ -4,7 +4,7 @@
CROSS_COMPILE?=arm-none-eabi-
CC=gcc
-LD=ld
+LD=gcc
AR=ar
SIZE=size
OBJCOPY=objcopy
@@ -22,7 +22,7 @@ CFLAGS += -g$(DEBUGF)
#ASFLAGS=--g$(DEBUGF) $(INCLUDES) -D__ASSEMBLY__
ASFLAGS=$(INCLUDES) -D__ASSEMBLY__
-LDFLAGS = -nostartfiles -nostdlib -nodefaultlibs --gc-sections --cref
+LDFLAGS = -nostartfiles -nostdlib -nodefaultlibs -Wl,--gc-sections -Wl,--cref
#### QUIET OUTPUT ####
@@ -99,8 +99,8 @@ $(1)_$(2)_$(3)_OBJS+=board/$(2)/$(1).$(3).manifest.o
# define compilation rule, also generates map file
board/$(2)/$(1).$(3).elf board/$(2)/$(1).$(3).map: $$($(1)_$(2)_$(3)_OBJS) $$($(1)_$(2)_$(3)_LIBS) $$(ENV_$(3)_LDS)
$$(Q_LD)$(CROSS_COMPILE)$(LD) $(LDFLAGS) -T $$(ENV_$(3)_LDS) -Bstatic \
- -Map board/$(2)/$(1).$(3).map -o board/$(2)/$(1).$(3).elf \
- --start-group $$($(1)_$(2)_$(3)_OBJS) $$($(1)_$(2)_$(3)_LIBS) --end-group
+ -Wl,-Map board/$(2)/$(1).$(3).map -o board/$(2)/$(1).$(3).elf \
+ -Wl,--start-group $$($(1)_$(2)_$(3)_OBJS) $$($(1)_$(2)_$(3)_LIBS) -Wl,--end-group
# define size rule
board/$(2)/$(1).$(3).size: board/$(2)/$(1).$(3).elf