From 52b1bf2c5cd2f8af880dab503d0039b35570665b Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Thu, 23 Jul 2009 13:15:59 +0200 Subject: Make linking against libgcc configurable Many (especially ARM) tool chains seem to come with broken or otherwise unusable (for the purposes of builing U-Boot) run-time support libraries `libgcc.a'. By using the "USE_PRIVATE_LIBGCC" setting we allow to use alternative libraries instead. "USE_PRIVATE_LIBGCC" can either be set as an environment variable in the shell, or as a command line argument when running "make", i. e. $ make USE_PRIVATE_LIBGCC=yes or $ USE_PRIVATE_LIBGCC=yes $ export USE_PRIVATE_LIBGCC $ make The value of "USE_PRIVATE_LIBGCC" is the name of the directory which contains the alternative run-time support library `libgcc.a'. The special value "yes" selects the directory $(OBJTREE)/lib_$(ARCH) . Note that not all architectures provide an alternative `libgcc.a' in their lib_$(ARCH) directories - so far, only ARM does. Signed-off-by: Wolfgang Denk Cc: Jean-Christophe PLAGNIOL-VILLARD Cc: Prafulla Wadaskar cc: Stefan Roese --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 17605d46b..22bfeebc2 100644 --- a/Makefile +++ b/Makefile @@ -254,7 +254,17 @@ 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 +ifdef USE_PRIVATE_LIBGCC +ifeq ("$(USE_PRIVATE_LIBGCC)", "yes") +PLATFORM_LIBGCC = -L $(OBJTREE)/lib_$(ARCH) -lgcc +else +PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc +endif +else +PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc +endif +PLATFORM_LIBS += $(PLATFORM_LIBGCC) +export PLATFORM_LIBS ifeq ($(CONFIG_NAND_U_BOOT),y) NAND_SPL = nand_spl -- cgit v1.2.3