Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753958AbdDDN6O (ORCPT ); Tue, 4 Apr 2017 09:58:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43054 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752213AbdDDN6N (ORCPT ); Tue, 4 Apr 2017 09:58:13 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9682467EB4 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=acme@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9682467EB4 Date: Tue, 4 Apr 2017 10:58:09 -0300 From: Arnaldo Carvalho de Melo To: jiada_wang@mentor.com Cc: jpoimboe@redhat.com, linux-kernel@vger.kernel.org, erosca@de.adit-jv.com, acme@kernel.org Subject: Re: [PATCH v2 1/1] tools build: transform ARCH to supported values Message-ID: <20170404135809.GA2607@redhat.com> References: <1491201719-3532-1-git-send-email-jiada_wang@mentor.com> <1491201719-3532-2-git-send-email-jiada_wang@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1491201719-3532-2-git-send-email-jiada_wang@mentor.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 04 Apr 2017 13:58:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2174 Lines: 59 Em Sun, Apr 02, 2017 at 11:41:59PM -0700, jiada_wang@mentor.com escreveu: > From: Jiada Wang > > with commit: 0a943cb10ce7 (tools build: Add HOSTARCH Makefile variable) > the following build failure is seen with ARCH=x86_84 > > In file included from util/event.c:2:0: > tools/include/uapi/linux/mman.h:4:27: fatal error: uapi/asm/mman.h: No such file or directory > compilation terminated. > > This patch by evaluate ARCH to supported values just as the behavior before > above mentioned patch to fix the issue. Humm, why not use what the kernel proper uses 6752ed90da032af72f2f1fa23d1abf0889b56db0), and that objtool adopted in: commit 60cbdf5d051d4f4db23d267d511ca241d4be7c0d Author: Josh Poimboeuf Date: Fri Jul 22 14:19:20 2016 -0500 tools build: Fix objtool build with ARCH=x86_64 The objtool build fails in a cross-compiled environment on a non-x86 host with "ARCH=x86_64": - Arnaldo > Signed-off-by: Jiada Wang > Signed-off-by: Eugeniu Rosca > --- > tools/scripts/Makefile.arch | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/tools/scripts/Makefile.arch b/tools/scripts/Makefile.arch > index ad85b92..41cfc56 100644 > --- a/tools/scripts/Makefile.arch > +++ b/tools/scripts/Makefile.arch > @@ -1,4 +1,4 @@ > -HOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ > +purify-arch = $(shell echo $1 | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ > -e s/sun4u/sparc/ -e s/sparc64/sparc/ \ > -e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \ > -e s/s390x/s390/ -e s/parisc64/parisc/ \ > @@ -6,8 +6,12 @@ HOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ > -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \ > -e s/tile.*/tile/ ) > > +HOSTARCH := $(call purify-arch,$(shell uname -m)) > + > ifndef ARCH > ARCH := $(HOSTARCH) > +else > +ARCH := $(call purify-arch,$(ARCH)) > endif > > SRCARCH := $(ARCH) > -- > 1.7.9.5 >