public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Makefile: Introduce ARCH_PLATFORM_LIBGCC variable
@ 2013-10-11 20:13 Tom Rini
  2013-10-11 21:01 ` Tom Rini
  2013-10-12  7:43 ` Albert ARIBAUD
  0 siblings, 2 replies; 5+ messages in thread
From: Tom Rini @ 2013-10-11 20:13 UTC (permalink / raw)
  To: u-boot

In some cases, such as arm multi-lib hardfloat (hf) toolchains, we will
have multiple libgcc.a's available, and the arch needs to provide
additional logic to determine the right file to use
(-print-libgcc-file-name contains no CFLAG parsing logic).

Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Signed-off-by: Tom Rini <trini@ti.com>
---
 Makefile           |    4 ++++
 arch/arm/config.mk |   11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/Makefile b/Makefile
index b09bfcc..13b396f 100644
--- a/Makefile
+++ b/Makefile
@@ -357,8 +357,12 @@ else
 PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
 endif
 else
+ifneq ("$(ARCH_PLATFORM_LIBGCC)","")
+PLATFORM_LIBGCC := -L $(shell dirname $(ARCH_PLATFORM_LIBGCC)) -lgcc
+else
 PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
 endif
+endif
 PLATFORM_LIBS += $(PLATFORM_LIBGCC)
 export PLATFORM_LIBS
 
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index d0cf43f..e1d0dec 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -19,6 +19,17 @@ LDFLAGS_FINAL += --gc-sections
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections \
                      -fno-common -ffixed-r9 -msoft-float
 
+#
+# When we use a hardfp toolchain if there are both 'libgcc.a' (hardfp) and
+# 'arm-linux-gnueabi/libgcc.a' (softfp) we need to use the latter.  We
+# cannot always build with a hardfp-only toolchain.
+#
+ARCH_PLATFORM_LIBGCC := $(shell \
+	X=`$(CC) -print-file-name=arm-linux-gnueabi/libgcc.a`; \
+	if [ -f $$X ]; then echo $$X ; \
+	else $(CC) -print-file-name=libgcc.a ; \
+	fi)
+
 # Support generic board on ARM
 __HAVE_ARCH_GENERIC_BOARD := y
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-14 17:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-11 20:13 [U-Boot] [PATCH] Makefile: Introduce ARCH_PLATFORM_LIBGCC variable Tom Rini
2013-10-11 21:01 ` Tom Rini
2013-10-12  7:43 ` Albert ARIBAUD
2013-10-14 15:16   ` Tom Rini
2013-10-14 17:06     ` Albert ARIBAUD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox