From: Masahiro Yamada Date: Fri, 16 May 2014 16:05:56 +0900 Subject: [U-Boot] [PATCH v2] examples: select libgcc for non-default architecture In-Reply-To: <1400222167-22402-1-git-send-email-abrodkin@synopsys.com> References: <1400222167-22402-1-git-send-email-abrodkin@synopsys.com> Message-ID: <20140516160556.E1A8.AA925319@jp.panasonic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Alexey, Wolfgang, > --- a/examples/standalone/Makefile > +++ b/examples/standalone/Makefile > @@ -38,7 +38,17 @@ targets += $(patsubst $(obj)/%,%,$(LIB)) $(COBJS) $(LIBOBJS-y) > LIBOBJS := $(addprefix $(obj)/,$(LIBOBJS-y)) > ELF := $(addprefix $(obj)/,$(ELF)) > > -gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`) > +# Add GCC lib > +ifdef CONFIG_USE_PRIVATE_LIBGCC > +ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y) > +PLATFORM_LIBGCC = arch/$(ARCH)/lib/lib.a > +else > +PLATFORM_LIBGCC = -L $(CONFIG_USE_PRIVATE_LIBGCC) -lgcc > +endif > +else > +PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(PLATFORM_CPPFLAGS) \ > + -print-libgcc-file-name`) -lgcc > +endif This is duplicating the code. I think you should export PLATFORM_LIBGCC from the top Makefile and use it. Best Regards Masahiro Yamada