From patchwork Thu May 15 17:47:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 349326 X-Patchwork-Delegate: wd@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id CE5A1140094 for ; Fri, 16 May 2014 03:48:24 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 876964BAEA; Thu, 15 May 2014 19:48:21 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PmDUVcZIUTeA; Thu, 15 May 2014 19:48:21 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3BF3F4BAE0; Thu, 15 May 2014 19:48:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7F2254BAE0 for ; Thu, 15 May 2014 19:48:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B3CxujmYb5Rv for ; Thu, 15 May 2014 19:48:13 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtprelay.synopsys.com (smtprelay.synopsys.com [198.182.60.111]) by theia.denx.de (Postfix) with ESMTPS id F29DD4BADF for ; Thu, 15 May 2014 19:48:06 +0200 (CEST) Received: from us01secmta2.synopsys.com (us01secmta2.synopsys.com [10.9.203.102]) by smtprelay.synopsys.com (Postfix) with ESMTP id 3313910C0EC2; Thu, 15 May 2014 10:48:02 -0700 (PDT) Received: from us01secmta2.internal.synopsys.com (us01secmta2.internal.synopsys.com [127.0.0.1]) by us01secmta2.internal.synopsys.com (Service) with ESMTP id ECAD7A4112; Thu, 15 May 2014 10:48:01 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.9.202.240]) by us01secmta2.internal.synopsys.com (Service) with ESMTP id C8CA7A4102; Thu, 15 May 2014 10:48:01 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id B933C1E3; Thu, 15 May 2014 10:48:01 -0700 (PDT) Received: from abrodkin-8560l.internal.synopsys.com (abrodkin-8560l.internal.synopsys.com [10.121.8.115]) by mailhost.synopsys.com (Postfix) with ESMTP id 36F151C5; Thu, 15 May 2014 10:47:59 -0700 (PDT) From: Alexey Brodkin To: u-boot@lists.denx.de Date: Thu, 15 May 2014 21:47:55 +0400 Message-Id: <1400176075-8709-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 1.9.0 Cc: Tom Rini , Alexey Brodkin Subject: [U-Boot] [PATCH] examples: select libgcc for non-default architecture X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Cc: Masahiro Yamada Cc: Tom Rini Acked-by: Masahiro Yamada --- 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