This patch allow to overwrit the libgcc Makefile inclusion from the toplevel
Makefile by the arch_config.mk files. This is in preparation for the ARM
architecture to move away from including libgcc function and only using
self-contained U-Boot functions as done in Linux.

Currently all the ARM boards that use the nand are broken due to the adding of
the 64 Bit device size support. In the past we have seen problems with different
toolchains due to EABI, FPU as example.
With this patch and the following one we move away from all these problems and
we will be able to have full control to have a functions embedded into u-boot.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagn...@jcrosoft.com>
---
V5
typo fix
 Makefile                 |    3 ++-
 api_examples/Makefile    |    4 +---
 board/netstar/Makefile   |    4 +---
 board/sl8245/config.mk   |    1 -
 board/trab/Makefile      |    2 --
 board/voiceblue/Makefile |    4 +---
 examples/Makefile        |    2 +-
 7 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index 2a06440..e2a61fb 100644
--- a/Makefile
+++ b/Makefile
@@ -288,7 +288,8 @@ LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).a
 LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
 
 # Add GCC lib
-PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) 
-lgcc
+PLATFORM_LIBGCC ?= -L $(shell dirname `$(CC) $(CFLAGS) 
-print-libgcc-file-name`) -lgcc
+PLATFORM_LIBS += $(PLATFORM_LIBGCC)
 
 ifeq ($(CONFIG_NAND_U_BOOT),y)
 NAND_SPL = nand_spl
diff --git a/api_examples/Makefile b/api_examples/Makefile
index 4c01437..4bfa7e6 100644
--- a/api_examples/Makefile
+++ b/api_examples/Makefile
@@ -56,8 +56,6 @@ OBJS  := $(addprefix $(obj),$(COBJS))
 ELF    := $(addprefix $(obj),$(ELF))
 BIN    := $(addprefix $(obj),$(BIN))
 
-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
-
 CPPFLAGS += -I..
 
 all:   $(obj).depend $(OBJS) $(LIB) $(ELF) $(BIN)
@@ -70,7 +68,7 @@ $(ELF):
 $(obj)%:       $(obj)%.o $(LIB)
                $(LD) $(obj)crt0.o -Ttext $(LOAD_ADDR) \
                        -o $@ $< $(LIB) \
-                       -L$(gcclibdir) -lgcc
+                       $(PLATFORM_LIBGCC)
 
 $(BIN):
 $(obj)%.bin:   $(obj)%
diff --git a/board/netstar/Makefile b/board/netstar/Makefile
index 91bac38..a52ded4 100644
--- a/board/netstar/Makefile
+++ b/board/netstar/Makefile
@@ -36,8 +36,6 @@ SRCS  := $(SOBJS:.o=.S) $(COBJS:.o=.c) eeprom.c \
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
-
 LOAD_ADDR = 0x10400000
 LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
 lnk = $(if $(obj),$(obj),.)
@@ -55,7 +53,7 @@ $(obj)eeprom.srec:    $(obj)eeprom.o $(obj)eeprom_start.o
                -o $(<:.o=) -e eeprom eeprom.o eeprom_start.o \
                -L$(obj)../../examples -lstubs \
                -L$(obj)../../lib_generic -lgeneric \
-               -L$(gcclibdir) -lgcc
+               $(PLATFORM_LIBGCC)
        $(OBJCOPY) -O srec $(<:.o=) $@
 
 $(obj)eeprom.bin:      $(obj)eeprom.srec
diff --git a/board/sl8245/config.mk b/board/sl8245/config.mk
index 022512b..299fc6c 100644
--- a/board/sl8245/config.mk
+++ b/board/sl8245/config.mk
@@ -28,4 +28,3 @@
 TEXT_BASE = 0xFFF00000
 
 PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
-PLATFORM_LIBS += $(shell $(CC) -print-libgcc-file-name)
diff --git a/board/trab/Makefile b/board/trab/Makefile
index 30e5fbb..a3661c4 100644
--- a/board/trab/Makefile
+++ b/board/trab/Makefile
@@ -36,8 +36,6 @@ SOBJS := $(addprefix $(obj),$(SOBJS))
 
 OBJS_FKT := $(addprefix $(obj),$(COBJS_FKT))
 
-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
-
 LOAD_ADDR = 0xc100000
 
 #########################################################################
diff --git a/board/voiceblue/Makefile b/board/voiceblue/Makefile
index e7c1cbb..369dc0b 100644
--- a/board/voiceblue/Makefile
+++ b/board/voiceblue/Makefile
@@ -33,8 +33,6 @@ SRCS  := $(SOBJS:.o=.S) $(COBJS:.o=.c) eeprom.c eeprom_start.S
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
-
 LOAD_ADDR = 0x10400000
 LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
 lnk = $(if $(obj),$(obj),.)
@@ -49,7 +47,7 @@ $(obj)eeprom.srec:    $(obj)eeprom.o $(obj)eeprom_start.o
                -o $(<:.o=) -e eeprom eeprom.o eeprom_start.o \
                -L$(obj)../../examples -lstubs \
                -L$(obj)../../lib_generic -lgeneric \
-               -L$(gcclibdir) -lgcc
+               $(PLATFORM_LIBGCC)
        $(OBJCOPY) -O srec $(<:.o=) $@
 
 $(obj)eeprom.bin:      $(obj)eeprom.srec
diff --git a/examples/Makefile b/examples/Makefile
index dbcfa92..5bd13f1 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -178,7 +178,7 @@ $(ELF):
 $(obj)%:       $(obj)%.o $(LIB)
                $(LD) -g $(EX_LDFLAGS) -Ttext $(LOAD_ADDR) \
                        -o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \
-                       -L$(gcclibdir) -lgcc
+                       $(PLATFORM_LIBGCC)
 
 $(SREC):
 $(obj)%.srec:  $(obj)%
-- 
1.6.3.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to