From patchwork Wed Aug 27 12:29:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 383440 X-Patchwork-Delegate: trini@ti.com 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 8AE2A14008B for ; Wed, 27 Aug 2014 22:38:51 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 299F3A750C; Wed, 27 Aug 2014 14:38:47 +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 rfAOiNH0NGze; Wed, 27 Aug 2014 14:38:46 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3E0F5A74CF; Wed, 27 Aug 2014 14:38:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B4805A74CF for ; Wed, 27 Aug 2014 14:38:38 +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 sN++mX2c8Ag3 for ; Wed, 27 Aug 2014 14:38:35 +0200 (CEST) X-Greylist: delayed 548 seconds by postgrey-1.27 at theia; Wed, 27 Aug 2014 14:38:32 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.free-electrons.com (top.free-electrons.com [176.31.233.9]) by theia.denx.de (Postfix) with ESMTP id 6B63AA74C2 for ; Wed, 27 Aug 2014 14:38:32 +0200 (CEST) Received: by mail.free-electrons.com (Postfix, from userid 106) id E628A700; Wed, 27 Aug 2014 14:29:22 +0200 (CEST) Received: from localhost (189.64.128.77.rev.sfr.net [77.128.64.189]) by mail.free-electrons.com (Postfix) with ESMTPSA id A976A59A; Wed, 27 Aug 2014 14:29:11 +0200 (CEST) From: Thomas Petazzoni To: u-boot@lists.denx.de Date: Wed, 27 Aug 2014 14:29:00 +0200 Message-Id: <1409142540-22651-1-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.0.0 Cc: Thomas Petazzoni , Sonic Zhang Subject: [U-Boot] [PATCH] tools/env: change stripping strategy to allow no-stripping 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 When building the U-Boot tools for non-ELF platforms (such as Blackfin FLAT), since commit 79fc0c5f498c3982aa4740c273ab1a9255063d9c ("tools/env: cross-compile fw_printenv without setting HOSTCC"), the build fails because it tries to strip a FLAT binary, which does not make sense. This commit solves this by changing the stripping logic in tools/env/Makefile to be similar to the one in tools/Makefile. This logic continues to apply strip to the final binary, but does not abort the build if it fails, and does the stripping in place on the final binary. This allows the logic to work fine if stripping doesn't work, as it leaves the final binary untouched. Signed-off-by: Thomas Petazzoni Cc: Masahiro Yamada Cc: Sonic Zhang Reviewed-by: Masahiro Yamada Reviewed-by: Sonic Zhang --- An improved solution would be to be able to override STRIP completely by setting it to /bin/true, but the main Makefile enforces STRIP = $(CROSS_COMPILE)strip. Signed-off-by: Thomas Petazzoni --- tools/env/Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/env/Makefile b/tools/env/Makefile index 4927489..40164f7 100644 --- a/tools/env/Makefile +++ b/tools/env/Makefile @@ -21,14 +21,16 @@ HOST_EXTRACFLAGS += -DMTD_OLD endif always := fw_printenv -hostprogs-y := fw_printenv_unstripped +hostprogs-y := fw_printenv -fw_printenv_unstripped-objs := fw_env.o fw_env_main.o \ +fw_printenv-objs := fw_env.o fw_env_main.o \ crc32.o ctype.o linux_string.o \ env_attr.o env_flags.o aes.o -quiet_cmd_strip = STRIP $@ - cmd_strip = $(STRIP) -o $@ $< +quiet_cmd_crosstools_strip = STRIP $^ + cmd_crosstools_strip = $(STRIP) $^; touch $@ -$(obj)/fw_printenv: $(obj)/fw_printenv_unstripped FORCE - $(call if_changed,strip) +$(obj)/.strip: $(obj)/fw_printenv + $(call cmd,crosstools_strip) + +always += .strip