Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4350046ybi; Mon, 3 Jun 2019 09:26:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwizMjuQGiOo2116IGTMbQROtk3ZoFLO3vDoCsXJQsoIELG6Ql7zRmOwD60jmdfybc2V5ES X-Received: by 2002:a62:1993:: with SMTP id 141mr31351076pfz.97.1559579179265; Mon, 03 Jun 2019 09:26:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559579179; cv=none; d=google.com; s=arc-20160816; b=gTJBx8kuuZFslpkv505+AJhuSBWmoUKmWl1zse/pJ6ZS/w/HBUgqUQetFJKsEnZYVl 0XGpnkFdNsHbxcnpwZxQOF7K9peV9aKUzOgJmBmYHjID+cr5lBkYtCNlDY/mqYSgyNdf FeDbg362ojEvr0r4aIJRbFGKUg5o1kvoyQEQeSP+LpBOmApWbvOqq6htbUOqPf8XmsAF XIVXLf+cLsReatPgtNwC/QiP/2coqICHDGLwiDo4DEe7SqYj6MLRNOVPlu1Ns+3iCnPI dM+uQffRrj09ctz2e+XYz9B1pD21rCUiCGK9y12rKEngJCJwawgdOKQaZ6HRJufm7iiH yfZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=pTW/ZSgJT8DCzoq0IOA9JuQ7EJ2yFSZWFyP+TNaX+Hk=; b=Zr3KHuHcq/aMsaPPvR5RDLXmoEiiH64YLKMRzTXPjc1vu72H2Ndn/Ylb/kOZUE7kAw /0yeDG6PU9Gu4huVdEUrBqsv+c+0bCpOPdIQSdj7j1Sx/HjbvQa87PRY5f2xomY7KSGq YeUpXv/V7mGGnQWv0kOnPJb+/i+Z+0C1mkhZEbMr900Rigq071nLsuENrNHfPKZHzZ71 ixeNEaz67KG3VLxgyAOuMCoJ3PfGJLsq1riDTosQ3iA0p8N+Y3TWfxFRcRi9teJ5Kvbh eRB3T9tVtvF6u99H9Pqgg+nnCfEYLWWQdMj/i3zfQTI8YIpx5+xsEG4ssOBqURe5t1Mt D7EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=cewzcBd3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j17si20165681pfr.13.2019.06.03.09.26.02; Mon, 03 Jun 2019 09:26:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=cewzcBd3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728672AbfFCQYz (ORCPT + 99 others); Mon, 3 Jun 2019 12:24:55 -0400 Received: from smtprelay-out1.synopsys.com ([198.182.61.142]:46788 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727162AbfFCQYy (ORCPT ); Mon, 3 Jun 2019 12:24:54 -0400 Received: from mailhost.synopsys.com (badc-mailhost1.synopsys.com [10.192.0.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id CF72AC2124; Mon, 3 Jun 2019 16:24:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1559579074; bh=JX+elEHAI7MoI1Kj6PhDcFRioomBwhgwjAEA09vtnIg=; h=From:To:CC:Subject:Date:References:From; b=cewzcBd3vYNCfDC3IhKlsGl2ELoWAKv8GHqe4/WXW/yiEuN8pwH2OZUTGi2TMEHwf 9KMaMKjgt3MCVQ4zpaFkYE3YBK6o0WXALP+vdfaaPBdmdcyuHwNFCYbVKsbEba/8Zt kT93PPT9bOHPGzER8qLfuE4N41BpuMs0yXUp/g4Lknp5hRtwreAOyfp0fgXIQNshiw cfZi98+4IDMJwGEuQUwnPjmXUS8lW6Hfu4mls7Y+Vtmqs3TOrliVS7bGfgGCvN0IIA rKwf9ai8hA4F64MmFEo8UJCF2v2lBL5+7AIesFyqcDdo9tlxfKFDQ/ZjIxDnqxKBP+ BcGxQw2xGBo/w== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id 36BD3A0079; Mon, 3 Jun 2019 16:24:51 +0000 (UTC) Received: from us01wembx1.internal.synopsys.com ([169.254.1.22]) by US01WEHTC3.internal.synopsys.com ([::1]) with mapi id 14.03.0415.000; Mon, 3 Jun 2019 09:24:50 -0700 From: Vineet Gupta To: Alexey Brodkin , "linux-snps-arc@lists.infradead.org" CC: "linux-kernel@vger.kernel.org" , "Masahiro Yamada" Subject: Re: [PATCH] ARC: build: Try to guess CROSS_COMPILE with cc-cross-prefix Thread-Topic: [PATCH] ARC: build: Try to guess CROSS_COMPILE with cc-cross-prefix Thread-Index: AQHVGdX4wIpfF+K0XEmKZYQZNUp5WA== Date: Mon, 3 Jun 2019 16:24:49 +0000 Message-ID: References: <20190603063119.36544-1-abrodkin@synopsys.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.13.184.19] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/2/19 11:31 PM, Alexey Brodkin wrote:=0A= > For a long time we used to hard-code CROSS_COMPILE prefix=0A= > for ARC until it started to cause problems, so we decided to=0A= > solely rely on CROSS_COMPILE externally set by a user:=0A= > commit 40660f1fcee8 ("ARC: build: Don't set CROSS_COMPILE in arch's Makef= ile").=0A= >=0A= > While it works perfectly fine for build-systems where the prefix=0A= > gets defined anyways for us human beings it's quite an annoying=0A= > requirement especially given most of time the same one prefix=0A= > "arc-linux-" is all what we need.=0A= >=0A= > It looks like finally we're getting the best of both worlds:=0A= > 1. W/o cross-toolchain we still may install headers, build .dtb etc=0A= > 2. W/ cross-toolchain get the kerne built with only ARCH=3Darc=0A= >=0A= > Inspired by [1] & [2].=0A= >=0A= > [1] http://lists.infradead.org/pipermail/linux-snps-arc/2019-May/005788.h= tml=0A= > [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/co= mmit/?id=3Dfc2b47b55f17=0A= >=0A= > A side note: even though "cc-cross-prefix" does its job it pollutes=0A= > console with output of "which" for all the prefixes it didn't manage to f= ind=0A= > a matching cross-compiler for like that:=0A= > | # ARCH=3Darc make defconfig=0A= > | which: no arceb-linux-gcc in (~/.local/bin:~/bin:/usr/bin:/usr/sbin)=0A= > | *** Default configuration is based on 'nsim_hs_defconfig'=0A= >=0A= > Signed-off-by: Alexey Brodkin =0A= > Cc: Masahiro Yamada =0A= > Cc: Vineet Gupta =0A= =0A= Not a big deal but I'd propose we add "Suggested-by: vgupta" since that is = where=0A= it came from.=0A= =0A= @Masahiro san I suppose you are OK with this, so perhaps an Ack etc would b= e nice=0A= to have.=0A= =0A= Thx,=0A= -Vineet=0A= =0A= > ---=0A= > arch/arc/Makefile | 4 ++++=0A= > 1 file changed, 4 insertions(+)=0A= >=0A= > diff --git a/arch/arc/Makefile b/arch/arc/Makefile=0A= > index e2b991f75bc5..9cfd2ba7a12d 100644=0A= > --- a/arch/arc/Makefile=0A= > +++ b/arch/arc/Makefile=0A= > @@ -8,6 +8,10 @@=0A= > =0A= > KBUILD_DEFCONFIG :=3D nsim_hs_defconfig=0A= > =0A= > +ifeq ($(CROSS_COMPILE),)=0A= > +CROSS_COMPILE :=3D $(call cc-cross-prefix, arc-linux- arceb-linux-)=0A= > +endif=0A= > +=0A= > cflags-y +=3D -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__= =0A= > cflags-$(CONFIG_ISA_ARCOMPACT) +=3D -mA7=0A= > cflags-$(CONFIG_ISA_ARCV2) +=3D -mcpu=3Dhs38=0A= =0A=