2
1

0002-Makefile-drop-nostartfiles.patch 1.4 KB

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