board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / boot / afboot-stm32 / 0001-Use-ld-instead-of-gcc-for-linking.patch
blob3f359dc31621f46863bb5371ce88e0ce6e8e6b0b
1 From 0d581abe6620ac69adec321b94390e009802f36a Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Sun, 13 Mar 2016 14:32:33 +0100
4 Subject: [PATCH] Use ld instead of gcc for linking
6 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 ---
8 Makefile | 11 ++++++-----
9 1 file changed, 6 insertions(+), 5 deletions(-)
11 diff --git a/Makefile b/Makefile
12 index ce40314..271bb4f 100644
13 --- a/Makefile
14 +++ b/Makefile
15 @@ -1,6 +1,7 @@
16 CROSS_COMPILE ?= arm-none-eabi-
18 CC = $(CROSS_COMPILE)gcc
19 +LD = $(CROSS_COMPILE)ld
20 OBJCOPY = $(CROSS_COMPILE)objcopy
21 OBJDUMP = $(CROSS_COMPILE)objdump
22 SIZE = $(CROSS_COMPILE)size
23 @@ -10,7 +11,7 @@ OPENOCD = openocd
24 CFLAGS := -mthumb -mcpu=cortex-m4
25 CFLAGS += -ffunction-sections -fdata-sections
26 CFLAGS += -Os -std=gnu99 -Wall
27 -LDFLAGS := -nostartfiles -Wl,--gc-sections
28 +LINKERFLAGS := -nostartfiles --gc-sections
30 obj-y += gpio.o mpu.o
31 obj-f4 += $(obj-y) usart-f4.o
32 @@ -22,22 +23,22 @@ all: stm32f429i-disco stm32429i-eval stm32f469i-disco stm32746g-eval
33 $(CC) -c $(CFLAGS) $< -o $@
35 stm32f429i-disco: stm32f429i-disco.o $(obj-f4)
36 - $(CC) -T stm32f429.lds $(LDFLAGS) -o stm32f429i-disco.elf stm32f429i-disco.o $(obj-f4)
37 + $(LD) -T stm32f429.lds $(LINKERFLAGS) -o stm32f429i-disco.elf stm32f429i-disco.o $(obj-f4)
38 $(OBJCOPY) -Obinary stm32f429i-disco.elf stm32f429i-disco.bin
39 $(SIZE) stm32f429i-disco.elf
41 stm32429i-eval: stm32429i-eval.o $(obj-f4)
42 - $(CC) -T stm32f429.lds $(LDFLAGS) -o stm32429i-eval.elf stm32429i-eval.o $(obj-f4)
43 + $(LD) -T stm32f429.lds $(LINKERFLAGS) -o stm32429i-eval.elf stm32429i-eval.o $(obj-f4)
44 $(OBJCOPY) -Obinary stm32429i-eval.elf stm32429i-eval.bin
45 $(SIZE) stm32429i-eval.elf
47 stm32f469i-disco: stm32f469i-disco.o $(obj-f4)
48 - $(CC) -T stm32f429.lds $(LDFLAGS) -o stm32f469i-disco.elf stm32f469i-disco.o $(obj-f4)
49 + $(LD) -T stm32f429.lds $(LINKERFLAGS) -o stm32f469i-disco.elf stm32f469i-disco.o $(obj-f4)
50 $(OBJCOPY) -Obinary stm32f469i-disco.elf stm32f469i-disco.bin
51 $(SIZE) stm32f469i-disco.elf
53 stm32746g-eval: stm32746g-eval.o $(obj-f7)
54 - $(CC) -T stm32f429.lds $(LDFLAGS) -o stm32746g-eval.elf stm32746g-eval.o $(obj-f7)
55 + $(LD) -T stm32f429.lds $(LINKERFLAGS) -o stm32746g-eval.elf stm32746g-eval.o $(obj-f7)
56 $(OBJCOPY) -Obinary stm32746g-eval.elf stm32746g-eval.bin
57 $(SIZE) stm32746g-eval.elf
59 --
60 2.6.4