From patchwork Mon Mar 13 08:43:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 95194 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp1076664qgd; Mon, 13 Mar 2017 01:44:13 -0700 (PDT) X-Received: by 10.28.236.209 with SMTP id h78mr9639919wmi.97.1489394653420; Mon, 13 Mar 2017 01:44:13 -0700 (PDT) Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id q109si23650719wrb.303.2017.03.13.01.44.13; Mon, 13 Mar 2017 01:44:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id DDBD5C21C5A; Mon, 13 Mar 2017 08:44:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 47575C21C32; Mon, 13 Mar 2017 08:44:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B47DDC21C32; Mon, 13 Mar 2017 08:44:09 +0000 (UTC) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lists.denx.de (Postfix) with ESMTPS id 94397C21C2D for ; Mon, 13 Mar 2017 08:44:08 +0000 (UTC) Received: from pug.jp.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id v2D8hK0a002256; Mon, 13 Mar 2017 17:43:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v2D8hK0a002256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1489394601; bh=2FZINnIG0XL30ClXO9yeKnQb8KcfnNFFGlPhDAr4BIM=; h=From:To:Cc:Subject:Date:From; b=X6kgy0Pk2rVVBvMGc+8/wXWVy+9+g66aocAUlOyEXWmYcf299arkEBStsqy7HIBMu 4ilQti0b5BbNYzBdMab5DvlxN3o3Fcli47xfjOrOxQuI+lPPtnOeXKfi8oamODPB/b PQWNW/Han9ma3uRQ02JYNJym5bAduge0zGbnZL382n4IOCd+AEJ5znxwSwXAcZxYMB AVHwu7FKOsNorhJcEh5CgFLZnIc6KY6/uhRiDL7eH0xQdRo36BTDmJpGp2kP8vzl14 NeW9hn/7VCcM7O7S1rASyOIrQgRACym3vlExevsMO6aNGTcWkKYLys3JGbonT1HJRn U35dNvwS0WAiA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 13 Mar 2017 17:43:16 +0900 Message-Id: <1489394596-1121-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Cc: Tom Rini , Hans de Goede , "oliver@schinagl.nl" , Andre Przywara , Joe Hershberger , Olliver Schinagl Subject: [U-Boot] [PATCH] tools: fix cross-compiling tools when HOSTCC is overridden X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Richard reported U-Boot tools issues in OpenEmbedded/Yocto project. OE needs to be able to change the default compiler. If we pass in HOSTCC through the make command, it overwrites all HOSTCC instances, including ones in tools/Makefile and tools/env/Makefile, which breaks "make cross_tools" and "make env", respectively. Add "override" directives to avoid overriding HOSTCC instances that really need to point to the cross-compiler. Signed-off-by: Masahiro Yamada Reported-by: Richard Purdie Reviewed-by: Simon Glass --- tools/Makefile | 2 +- tools/env/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 1c840d7..a894b5c 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -262,7 +262,7 @@ $(LOGO_DATA_H): $(obj)/bmp_logo $(LOGO_BMP) subdir- += env ifneq ($(CROSS_BUILD_TOOLS),) -HOSTCC = $(CC) +override HOSTCC = $(CC) quiet_cmd_crosstools_strip = STRIP $^ cmd_crosstools_strip = $(STRIP) $^; touch $@ diff --git a/tools/env/Makefile b/tools/env/Makefile index 38ad118..95b28c0 100644 --- a/tools/env/Makefile +++ b/tools/env/Makefile @@ -8,7 +8,7 @@ # fw_printenv is supposed to run on the target system, which means it should be # built with cross tools. Although it may look weird, we only replace "HOSTCC" # with "CC" here for the maximum code reuse of scripts/Makefile.host. -HOSTCC = $(CC) +override HOSTCC = $(CC) # Compile for a hosted environment on the target HOST_EXTRACFLAGS = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \