From patchwork Thu Nov 22 12:06:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 1001719 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hRjtuwiD"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="AJfCvnhA"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 430ypQ2PkDz9rxp for ; Thu, 22 Nov 2018 23:06:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=4+r7MSHQ3rXk+FkQ6hzT3mjqoOvuuDdf+FAIq810+cY=; b=hRj tuwiDKXNakHMyhXVhwIOPXkLLy8HAE+/yRgjIMIQ+C8eepS7IhN5YGCk8JflbOvLcUUFN/2AL0Puf w8M0kX01/C0XueWBcKI2as/QCekB4UYcrxxnpu15jsZ5aqAdPWMH76urSoJWwz0E34LxLxddPQ1u8 5YTvjIaslkTWBfkPqw9QkJz3CFRlm9rJApA5rRxqJ+hFkTRI+NRXB5ItU8qzJSoLxDix7fIbGO8/m ZAmIsB0NCtvpGksP2yd/c02FyszbulsijPdDXccEjiiFa+pD0FFjkr9AdfuRNZl7kejHpcQFkVk2T jK35k33WRsnbPCXtMbJZvoijJcaQWvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPnkS-0005ZG-F7; Thu, 22 Nov 2018 12:06:20 +0000 Received: from smtprelay.synopsys.com ([198.182.47.9]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPnkO-0005Ye-Uu for linux-snps-arc@lists.infradead.org; Thu, 22 Nov 2018 12:06:18 +0000 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 3495824E13A9; Thu, 22 Nov 2018 04:06:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1542888365; bh=uLVde2z2digV8FENoqLTMTExWAUG6Lbwb91RGEvOn3E=; h=From:To:Cc:Subject:Date:From; b=AJfCvnhAUU+hp37iESMfJXSh4a/A4MAWje8kkcvrhSUIHU+RKSGDTjUupsqDEHqXz 3kWOI83LQojp6NHCvh3PB6DcZvtrfm23UZQRa0/ymqdWb5E72Fin2Ho2n7f/fizfbd YvQ6zXomnp4Kk554dfaB2TmsMFP8c8oK3zW2IrCkDl8a5pGs/wjUFDBrQu8n7bURrG DYy0Yt4TTJK0B8Qa1tXHWy8605j/wJk+w7SfAp+Z4ssvivWp77IivcPOFoWBHIgHGP 4i/x2ibT7w6QxnPqxtd+N5y3RcQQJyLCD8eS4HiDryOw/AmGvEo9iMOsj92pfua0q6 MPizU6ptHJlsA== Received: from ru20arcgnu1.internal.synopsys.com (ru20arcgnu1.internal.synopsys.com [10.121.9.48]) by mailhost.synopsys.com (Postfix) with ESMTP id D00FE3984; Thu, 22 Nov 2018 04:06:03 -0800 (PST) From: Alexey Brodkin To: openembedded-core@lists.openembedded.org Subject: [PATCH] gcc: Select proper ARC CPU when build for target Date: Thu, 22 Nov 2018 15:06:00 +0300 Message-Id: <20181122120600.10061-1-abrodkin@synopsys.com> X-Mailer: git-send-email 2.16.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181122_040617_001901_B81973FA X-CRM114-Status: GOOD ( 13.02 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-snps-arc@lists.infradead.org, Alexey Brodkin , Ross Burton , Khem Raj MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org By default GCC for ARC is configured with ARC700 CPU. This means when we don't pass "-mcpu=xxx": a) Code will be compiled for ARC700 b) Libs will used for ARC700 And if we happen to run on ARCv2 core like ARC HSxx we won't be able to use target gcc w/o "-mcpu=xxx" which is not very convenient as we want to build "target" toolchain but not canadian-cross. Note the trick here is we set TUNE_PKGARCH in just 2 values, it is either "arc700" for all ARCompact cores (ARC750 & ARC770) and "archs" for all ARCv2 cores (ARC HS38 & HS48), see [1]. This gives us usable defaults. For cross-compilation we use TUNE_CCARGS for fine-tuning depending on which HW features we have on the current target so that we may have HW feature A & B or B & C or A & B & C, see [2]. [1] https://github.com/foss-for-synopsys-dwc-arc-processors/meta-synopsys/blob/master/conf/machine/include/tune-arcv2.inc#L4 [2] https://github.com/foss-for-synopsys-dwc-arc-processors/meta-synopsys/blob/master/conf/machine/include/tune-arcv2.inc#L34 Signed-off-by: Alexey Brodkin --- meta/recipes-devtools/gcc/gcc-target.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc index bc2236fed0..6270059644 100644 --- a/meta/recipes-devtools/gcc/gcc-target.inc +++ b/meta/recipes-devtools/gcc/gcc-target.inc @@ -20,6 +20,7 @@ ARMFPARCHEXT ?= "" EXTRA_OECONF_append_armv6 = " --with-arch=armv6${ARMFPARCHEXT}" EXTRA_OECONF_append_armv7a = " --with-arch=armv7-a${ARMFPARCHEXT}" EXTRA_OECONF_append_armv7ve = " --with-arch=armv7ve${ARMFPARCHEXT}" +EXTRA_OECONF_append_arc = " --with-cpu=${TUNE_PKGARCH}" # libcc1 requres gcc_cv_objdump when cross build, but gcc_cv_objdump is # set in subdir gcc, so subdir libcc1 can't use it, export it here to