[U-Boot] [PATCH] examples: select libgcc for non-default architecture

Alexey Brodkin Alexey.Brodkin at synopsys.com
Thu May 15 19:47:55 CEST 2014


In case of multilib-enabled toolchains if default architecture differ from
the one examples are being built for linker will fail to link example object
files with libgcc of another (non-compatible) architecture.

Interesting enough for years in main Makefile we used CFLAGS/c_flags for this
but not for examples.

So fixing it now.

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>

Cc: Masahiro Yamada <yamada.m at jp.panasonic.com>
Cc: Tom Rini <trini at ti.com>
---
 examples/standalone/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index 9ab5446..7234f30 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -38,7 +38,8 @@ targets += $(patsubst $(obj)/%,%,$(LIB)) $(COBJS) $(LIBOBJS-y)
 LIBOBJS	:= $(addprefix $(obj)/,$(LIBOBJS-y))
 ELF	:= $(addprefix $(obj)/,$(ELF))
 
-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
+gcclibdir := $(shell dirname \
+	       `$(CC) $(PLATFORM_CPPFLAGS) -print-libgcc-file-name`)
 
 # For PowerPC there's no need to compile standalone applications as a
 # relocatable executable.  The relocation data is not needed, and
-- 
1.9.0



More information about the U-Boot mailing list