From nobody Mon Feb 9 20:34:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1591380025; cv=none; d=zohomail.com; s=zohoarc; b=LXJpfImd2N0fy2gxCN8oLfnNXuJLc6iKHHxfXDtHK6sVY6+vifcY0HgJbPr8I5l8By6myrPAeBYCx9YKfkJADkeag+bO2TKlyQj3VX0xRIJrmrgcSF/6B4QGbLHmUeyniMKIMIk+7dqY5F0LY/TDIBNEW3J8OpZX+5H4XKdw5cI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591380025; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TSOCEBN9BjVMOixsoI8rbZYG9y/X6ScSulzjzqLLaGk=; b=Q5i6J2pN6/1dlMo8tko5OsHXhWxcpwY7q48WKBYo4LC2y5eZTtXDToH6FoJcXr87oj1AGLm6YnvYsyObrE1gjTazfS1/Pfpy7vRdlKx/fjXC28plL18KIGVRrJLHEu0uCHNFyvOseiaopeQzIuRDI4UeWXwKKhMmXk85OX6emog= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1591380025530715.2746387705188; Fri, 5 Jun 2020 11:00:25 -0700 (PDT) Received: from localhost ([::1]:35008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhGdh-0006nh-8K for importer@patchew.org; Fri, 05 Jun 2020 14:00:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhGcI-0005Lu-OI for qemu-devel@nongnu.org; Fri, 05 Jun 2020 13:58:54 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:53323 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jhGcG-0000IE-Gs for qemu-devel@nongnu.org; Fri, 05 Jun 2020 13:58:54 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-298-nApHhCwUPjCc7dYyw1FmYA-1; Fri, 05 Jun 2020 13:58:50 -0400 Received: by mail-wm1-f71.google.com with SMTP id u11so3239619wmc.7 for ; Fri, 05 Jun 2020 10:58:50 -0700 (PDT) Received: from localhost.localdomain (181.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.181]) by smtp.gmail.com with ESMTPSA id y14sm1850296wma.25.2020.06.05.10.58.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 10:58:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591379931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TSOCEBN9BjVMOixsoI8rbZYG9y/X6ScSulzjzqLLaGk=; b=B5xVBU9fluI3TFIqO4un3pFv/hIvYfG5SWnX7gppUdDsQP4b9IM2BegXcSPWDsLWVrdh+4 70dtuvog30h8poNCj47k+6jD7I0IXCDyZ4G5K1UI9IWGai7hznjFlljU0XhApMWbn+mD3r CvjsL1nRrJpgAFt9aVciIrT1dhqpKMc= X-MC-Unique: nApHhCwUPjCc7dYyw1FmYA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TSOCEBN9BjVMOixsoI8rbZYG9y/X6ScSulzjzqLLaGk=; b=hkL9o8G4f3G0TkiXRoKxJlXQTPgrgMiAY74rKoBiS+xKuECObpT1/4cfZ47zYO0EtL iI7z26PrLLn0zP4Di/tMQSMaV9VF5+LDqdwCBDHKDT0lzIT4A5nhLZ79kZGwRlALZmoW SNKYDuh0KrAwdqtwRuTr4fy1SEwXjLt0d1WHt8092u/C4+zAtVssSKy3JrHj1ZY+PWhd fbhbVYziwttTfw90DpojDykhfY+/UrdkT18Y/Jfen7cId4kU56Yw+ehLeKEVmdzjq1dB LEZJ2bCiBGro/gz5OWPljF6HoMFfwqfxmfmBVzLqq4XrTX1zlxHgK6Bqh7NEwopQo56G sJgg== X-Gm-Message-State: AOAM533PFl+KmgpvFbOJFM+DTMVzAhctD1akAawSFWYmP5ipn8tv0vBT Yp3qG7vakLYfARlBMSUEnvxmpJGygribFiyk26wQ1Xn4ry8rgJRw/q602EKUZgPoXh3HX78oWuD K6YxGAPUtlEmwVIE= X-Received: by 2002:adf:a507:: with SMTP id i7mr11867031wrb.0.1591379929023; Fri, 05 Jun 2020 10:58:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzf17Orc713wgG4cQIcdn7Ut6kLKdGwjZcozhnUr3qQcMaVEwsjDzILsEbBJhZECZomwEZaCg== X-Received: by 2002:adf:a507:: with SMTP id i7mr11867018wrb.0.1591379928850; Fri, 05 Jun 2020 10:58:48 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 05/11] rules.mak: Add base-arch() rule Date: Fri, 5 Jun 2020 19:58:15 +0200 Message-Id: <20200605175821.20926-6-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200605175821.20926-1-philmd@redhat.com> References: <20200605175821.20926-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/05 03:27:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Add a rule to return the base architecture for a QEMU target. The current list of TARGET_BASE_ARCH is: $ git grep TARGET_BASE_ARCH configure configure:7785:TARGET_BASE_ARCH=3D"" configure:7795: TARGET_BASE_ARCH=3Di386 configure:7813: TARGET_BASE_ARCH=3Darm configure:7846: TARGET_BASE_ARCH=3Dmips configure:7854: TARGET_BASE_ARCH=3Dmips configure:7864: TARGET_BASE_ARCH=3Dopenrisc configure:7871: TARGET_BASE_ARCH=3Dppc configure:7879: TARGET_BASE_ARCH=3Dppc configure:7887: TARGET_BASE_ARCH=3Dppc configure:7894: TARGET_BASE_ARCH=3Driscv configure:7900: TARGET_BASE_ARCH=3Driscv configure:7920: TARGET_BASE_ARCH=3Dsparc configure:7925: TARGET_BASE_ARCH=3Dsparc The rule can be tested calling 'print-base-arch-$TARGET': $ make \ print-base-arch-openrisc \ print-base-arch-aarch64_be \ print-base-arch-x86_64 \ print-base-arch-mips64el \ print-base-arch-ppc64 \ print-base-arch-riscv64 openrisc=3Dopenrisc aarch64_be=3Darm x86_64=3Di386 mips64el=3Dmips ppc64=3Dppc riscv64=3Driscv Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- rules.mak | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/rules.mak b/rules.mak index 7b58a6b8c5..c4f2f35754 100644 --- a/rules.mak +++ b/rules.mak @@ -452,3 +452,38 @@ atomic =3D $(eval $1: $(call sentinel,$1) ; @:) \ =20 print-%: @echo '$*=3D$($*)' + +# base-arch +# Usage: $(call base-arch, target) +# +# @target: the target architecture. +# +# This macro will return the base architecture for a target. +# +# As example, $(call base-arch, aarch64) returns 'arm'. +base-arch =3D $(strip \ + $(if $(call startswith,aarch64,$1),arm,\ + $(if $(call startswith,arm,$1),arm,\ + $(if $(call startswith,microblaze,$1),microblaze,\ + $(if $(call startswith,mips,$1),mips,\ + $(if $(call startswith,ppc,$1),ppc,\ + $(if $(call startswith,riscv,$1),riscv,\ + $(if $(call startswith,sh4,$1),sh4,\ + $(if $(call startswith,sparc,$1),sparc,\ + $(if $(call startswith,xtensa,$1),xtensa,\ + $(if $(call strequal,x86_64,$1),i386,\ + $1\ + )\ + )\ + )\ + )\ + )\ + )\ + )\ + )\ + )\ + )\ + ) + +print-base-arch-%: + @echo '$*=3D$(call base-arch,$*)' --=20 2.21.3