kumquat-buildroot/boot/afboot-stm32/0002-Makefile-drop-nostartfiles.patch
Thomas Petazzoni cf5206ea98 boot/afboot-stm32: add patch fixing build issue with recent binutils
The afboot-stm32 build system was initially linking with gcc, but that
was changed upstream following a Buildroot contribution to use ld
instead.

However, the build system was still passing -nostartfiles, which is a
gcc option. By luck, this option was simply ignored by older versions
of ld (such as binutils 2.32), but newer versions of ld (2.36 and
newer, at least) no longer accept/ignore this option.

This commit adds a patch that drops the use of this option, since it
is useless for ld.

The first patch is slightly updated because the upstream pull request
has been updated to contain both build fixes.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2022-04-28 23:45:07 +02:00

41 lines
1.4 KiB
Diff

From be760c062c5d05bd2223f3916afafd37120d3318 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Thu, 28 Apr 2022 22:47:09 +0200
Subject: [PATCH] Makefile: drop -nostartfiles
In commit 0f3e61c9dd48fd8b4248ce4672c044c2562e4de1 ("Use ld instead of
gcc for linking "), we started using ld instead of gcc for the link
step. This worked fine for a while, but recent versions of ld no
longer accept the -nostartfiles option, causing the build to break:
Error: unable to disambiguate: -nostartfiles (did you mean --nostartfiles ?)
In fact, -nostartfiles was passed to gcc prior to
0f3e61c9dd48fd8b4248ce4672c044c2562e4de1, but it is not a ld
option. It is only by luck that it was accepted and ignored by older
ld versions. Since this option is useless when calling ld directly, we
can simply drop it.
Upstream: https://github.com/mcoquelin-stm32/afboot-stm32/pull/11
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 1e8557d..8f42be1 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ CFLAGS := -mthumb -mcpu=cortex-m4
CFLAGS += -ffunction-sections -fdata-sections
CFLAGS += -Os -std=gnu99 -Wall
CFLAGS += -fno-builtin
-LINKERFLAGS := -nostartfiles --gc-sections
+LINKERFLAGS := --gc-sections
obj-y += gpio.o mpu.o qspi.o start_kernel.o
obj-f4 += $(obj-y) usart-f4.o
--
2.35.1