[U-Boot] [PATCH] Link the correct libgcc.a on ARMv4T architecture

Paul Hsu pochun.hsu at gmail.com
Wed Sep 8 09:54:58 CEST 2010


If we use $(CC -print-libgcc-file-name) without option -march=armv4t,
we will link the wrong version libgcc.a(for ARMv5).
That causes cpu core raising excptions when u-boot running on the board.

Signed-off-by:Paul Hsu <pochun.hsu at gmail.com>
---
 Makefile |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 4f1cb1b..978c9cd 100644
--- a/Makefile
+++ b/Makefile
@@ -259,6 +259,17 @@ LIBS := $(addprefix $(obj),$(LIBS))
 LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).a
 LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
 
+#check ARMV4T
+ifdef CPU
+ifeq ("$(CPU)","arm920t")
+ARMV4T := yes
+endif
+ifeq ("$(CPU)","arm720t")
+ARMV4T := yes
+endif
+endif
+
+
 # Add GCC lib
 ifdef USE_PRIVATE_LIBGCC
 ifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
@@ -267,8 +278,12 @@ else
 PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
 endif
 else
+ifeq ("$(ARMV4T)","yes")
+PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name -march=armv4t`) -lgcc
+else
 PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
 endif
+endif
 PLATFORM_LIBS += $(PLATFORM_LIBGCC)
 export PLATFORM_LIBS
 
-- 
1.7.0.4



More information about the U-Boot mailing list