From patchwork Thu Sep 29 03:36:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Che-liang Chiou X-Patchwork-Id: 116885 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 036EC1007D4 for ; Thu, 29 Sep 2011 13:37:07 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3D73B28420; Thu, 29 Sep 2011 05:37:03 +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 oWzJ9qlHvrsE; Thu, 29 Sep 2011 05:37:03 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6DA0E28410; Thu, 29 Sep 2011 05:37:01 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C595C28410 for ; Thu, 29 Sep 2011 05:36:59 +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 zqglG01Xt2GL for ; Thu, 29 Sep 2011 05:36:57 +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 mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.213.172]) by theia.denx.de (Postfix) with ESMTPS id 83D8B2840B for ; Thu, 29 Sep 2011 05:36:55 +0200 (CEST) Received: by yxt33 with SMTP id 33so250847yxt.3 for ; Wed, 28 Sep 2011 20:36:53 -0700 (PDT) Received: by 10.150.114.15 with SMTP id m15mr9033038ybc.166.1317267413311; Wed, 28 Sep 2011 20:36:53 -0700 (PDT) Received: from localhost.localdomain (weier.tpe.corp.google.com [172.30.210.5]) by mx.google.com with ESMTPS id o12sm122648ybc.9.2011.09.28.20.36.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Sep 2011 20:36:52 -0700 (PDT) From: Che-Liang Chiou To: u-boot@lists.denx.de Date: Thu, 29 Sep 2011 11:36:24 +0800 Message-Id: <1317267384-27599-1-git-send-email-clchiou@chromium.org> X-Mailer: git-send-email 1.7.3.1 Subject: [U-Boot] [PATCH] examples: api: allow build with private libgcc X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 The examples/api is not configured with USE_PRIVATE_LIBGCC. This makes building examples/api break on certain boards that do not/cannot use the public libgcc. Nevertheless, this patch has to also touch the top-level Makefile to fix this problem because the current top-level Makefile does not specify libgcc as a prerequisite of examples/api, and explicitly builds examples/api _before_ libgcc. For testing this patch, I added the following to configs/seaboard.h and ran demo.bin on a Seaboard. +#define CONFIG_API +#define CONFIG_SYS_MMC_MAX_DEVICE 2 +#define CONFIG_CMD_NET +#define CONFIG_NET_MULTI Signed-off-by: Che-Liang Chiou Acked-by: Mike Frysinger --- Makefile | 16 ++++++++++------ examples/api/Makefile | 4 +--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index dfe939f..550088f 100644 --- a/Makefile +++ b/Makefile @@ -137,9 +137,11 @@ unexport CDPATH # The "tools" are needed early, so put this first # Don't include stuff already done in $(LIBS) -SUBDIRS = tools \ - examples/standalone \ - examples/api +# The "examples" conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC +# is "yes"), so compile examples after U-Boot is compiled. +SUBDIR_TOOLS = tools +SUBDIR_EXAMPLES = examples/standalone examples/api +SUBDIRS = $(SUBDIR_TOOLS) $(SUBDIR_EXAMPLES) .PHONY : $(SUBDIRS) $(VERSION_FILE) @@ -350,7 +352,7 @@ ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin -all: $(ALL-y) +all: $(ALL-y) $(SUBDIR_EXAMPLES) $(obj)u-boot.hex: $(obj)u-boot $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ @@ -405,7 +407,7 @@ GEN_UBOOT = \ --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \ -Map u-boot.map -o u-boot $(obj)u-boot: depend \ - $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds + $(SUBDIR_TOOLS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds $(GEN_UBOOT) ifeq ($(CONFIG_KALLSYMS),y) smap=`$(call SYSTEM_MAP,u-boot) | \ @@ -418,7 +420,7 @@ endif $(OBJS): depend $(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@)) -$(LIBS): depend $(SUBDIRS) +$(LIBS): depend $(SUBDIR_TOOLS) $(MAKE) -C $(dir $(subst $(obj),,$@)) $(LIBBOARD): depend $(LIBS) @@ -427,6 +429,8 @@ $(LIBBOARD): depend $(LIBS) $(SUBDIRS): depend $(MAKE) -C $@ all +$(SUBDIR_EXAMPLES): $(obj)u-boot + $(LDSCRIPT): depend $(MAKE) -C $(dir $@) $(notdir $@) diff --git a/examples/api/Makefile b/examples/api/Makefile index 5b5f7a6..bad05af 100644 --- a/examples/api/Makefile +++ b/examples/api/Makefile @@ -62,8 +62,6 @@ OBJS += $(addprefix $(obj),$(COBJ_FILES-y)) OBJS += $(addprefix $(obj),$(notdir $(EXT_COBJ_FILES-y))) OBJS += $(addprefix $(obj),$(notdir $(EXT_SOBJ_FILES-y))) -gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`) - CPPFLAGS += -I.. all: $(obj).depend $(OUTPUT) @@ -71,7 +69,7 @@ all: $(obj).depend $(OUTPUT) ######################################################################### $(OUTPUT): $(OBJS) - $(LD) -Ttext $(LOAD_ADDR) -o $@ $^ -L$(gcclibdir) -lgcc + $(LD) -Ttext $(LOAD_ADDR) -o $@ $^ $(PLATFORM_LIBS) $(OBJCOPY) -O binary $@ $(OUTPUT).bin 2>/dev/null # Rule to build generic library C files