mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@26c91a9
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
From 5448f328ff63a6ca4a64519c2f1dfc63a33df4b7 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
Date: Thu, 10 Sep 2020 11:37:33 +0200
|
||||
Subject: [PATCH] Pass -fno-builtin to fix build with gcc 10
|
||||
|
||||
gcc 10, if it recognizes some hand-written code that looks like
|
||||
memcpy, will generate a call to memcpy().
|
||||
|
||||
For example:
|
||||
|
||||
while (dst < &_end_data) {
|
||||
*dst++ = *src++;
|
||||
}
|
||||
|
||||
gets recognized as such. However, in the context of bare-metal code,
|
||||
having a call to memcpy() in the C library doesn't work. So we fix
|
||||
that by disabling builtins.
|
||||
|
||||
Fixes:
|
||||
|
||||
/home/thomas/projets/buildroot/output/host/opt/ext-toolchain/bin/../arm-buildroot-uclinux-uclibcgnueabi/bin/ld.real: stm32f429i-disco.o: in function `reset':
|
||||
stm32f429i-disco.c:(.text.reset+0x1a): undefined reference to `memcpy'
|
||||
/home/thomas/projets/buildroot/output/host/opt/ext-toolchain/bin/../arm-buildroot-uclinux-uclibcgnueabi/bin/ld.real: stm32f429i-disco.c:(.text.reset+0x34): undefined reference to `memset'
|
||||
make[1]: *** [Makefile:26: stm32f429i-disco] Error 1
|
||||
|
||||
Upstream: https://github.com/mcoquelin-stm32/afboot-stm32/pull/9
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
Makefile | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index f699176..1e8557d 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -13,6 +13,7 @@ DTB_ADDR?=0x08004000
|
||||
CFLAGS := -mthumb -mcpu=cortex-m4
|
||||
CFLAGS += -ffunction-sections -fdata-sections
|
||||
CFLAGS += -Os -std=gnu99 -Wall
|
||||
+CFLAGS += -fno-builtin
|
||||
LINKERFLAGS := -nostartfiles --gc-sections
|
||||
|
||||
obj-y += gpio.o mpu.o qspi.o start_kernel.o
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
From 0d581abe6620ac69adec321b94390e009802f36a Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
Date: Sun, 13 Mar 2016 14:32:33 +0100
|
||||
Subject: [PATCH] Use ld instead of gcc for linking
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
---
|
||||
Makefile | 11 ++++++-----
|
||||
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index ce40314..271bb4f 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,7 @@
|
||||
CROSS_COMPILE ?= arm-none-eabi-
|
||||
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
+LD = $(CROSS_COMPILE)ld
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
OBJDUMP = $(CROSS_COMPILE)objdump
|
||||
SIZE = $(CROSS_COMPILE)size
|
||||
@@ -10,7 +11,7 @@ OPENOCD = openocd
|
||||
CFLAGS := -mthumb -mcpu=cortex-m4
|
||||
CFLAGS += -ffunction-sections -fdata-sections
|
||||
CFLAGS += -Os -std=gnu99 -Wall
|
||||
-LDFLAGS := -nostartfiles -Wl,--gc-sections
|
||||
+LINKERFLAGS := -nostartfiles --gc-sections
|
||||
|
||||
obj-y += gpio.o mpu.o
|
||||
obj-f4 += $(obj-y) usart-f4.o
|
||||
@@ -22,22 +23,22 @@ all: stm32f429i-disco stm32429i-eval stm32f469i-disco stm32746g-eval
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
stm32f429i-disco: stm32f429i-disco.o $(obj-f4)
|
||||
- $(CC) -T stm32f429.lds $(LDFLAGS) -o stm32f429i-disco.elf stm32f429i-disco.o $(obj-f4)
|
||||
+ $(LD) -T stm32f429.lds $(LINKERFLAGS) -o stm32f429i-disco.elf stm32f429i-disco.o $(obj-f4)
|
||||
$(OBJCOPY) -Obinary stm32f429i-disco.elf stm32f429i-disco.bin
|
||||
$(SIZE) stm32f429i-disco.elf
|
||||
|
||||
stm32429i-eval: stm32429i-eval.o $(obj-f4)
|
||||
- $(CC) -T stm32f429.lds $(LDFLAGS) -o stm32429i-eval.elf stm32429i-eval.o $(obj-f4)
|
||||
+ $(LD) -T stm32f429.lds $(LINKERFLAGS) -o stm32429i-eval.elf stm32429i-eval.o $(obj-f4)
|
||||
$(OBJCOPY) -Obinary stm32429i-eval.elf stm32429i-eval.bin
|
||||
$(SIZE) stm32429i-eval.elf
|
||||
|
||||
stm32f469i-disco: stm32f469i-disco.o $(obj-f4)
|
||||
- $(CC) -T stm32f429.lds $(LDFLAGS) -o stm32f469i-disco.elf stm32f469i-disco.o $(obj-f4)
|
||||
+ $(LD) -T stm32f429.lds $(LINKERFLAGS) -o stm32f469i-disco.elf stm32f469i-disco.o $(obj-f4)
|
||||
$(OBJCOPY) -Obinary stm32f469i-disco.elf stm32f469i-disco.bin
|
||||
$(SIZE) stm32f469i-disco.elf
|
||||
|
||||
stm32746g-eval: stm32746g-eval.o $(obj-f7)
|
||||
- $(CC) -T stm32f429.lds $(LDFLAGS) -o stm32746g-eval.elf stm32746g-eval.o $(obj-f7)
|
||||
+ $(LD) -T stm32f429.lds $(LINKERFLAGS) -o stm32746g-eval.elf stm32746g-eval.o $(obj-f7)
|
||||
$(OBJCOPY) -Obinary stm32746g-eval.elf stm32746g-eval.bin
|
||||
$(SIZE) stm32746g-eval.elf
|
||||
|
||||
--
|
||||
2.6.4
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# Locally calculated
|
||||
sha256 dbd715c8b99f7d266f74a04707a4dac76b75b31321f24dee5256a6348260530c afboot-stm32-0.1.tar.gz
|
||||
sha256 9b37b661bd3091ceb5d8dc5a56a2dfc02ae9ebc0c63dad3c4289c9d6b3d3ec89 afboot-stm32-0.2.tar.gz
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
AFBOOT_STM32_VERSION = 0.1
|
||||
AFBOOT_STM32_VERSION = 0.2
|
||||
AFBOOT_STM32_SITE = $(call github,mcoquelin-stm32,afboot-stm32,v$(AFBOOT_STM32_VERSION))
|
||||
AFBOOT_STM32_INSTALL_IMAGES = YES
|
||||
AFBOOT_STM32_INSTALL_TARGET = NO
|
||||
|
||||
Reference in New Issue
Block a user