From nobody Mon Feb 9 12:26:15 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=1591343052; cv=none; d=zohomail.com; s=zohoarc; b=Fo2/XUbNpTYmduEs8Mm0jO9yuoNbEhiRa0Wl6LKYlarJ4KfXt6P4RzPRxexLbAelcIg7nwJiNKRBiyw+luHjSqMFlxpMFYAEwfuM5KzUdGMZTz7X4NROzfOs20CKu6xrlLpDts9ICewFIMjEp5dboYjDP69hTF/XIhKKgk9T1hI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591343052; 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=VFGkz0p8Ozik1u5VT2fQxUZYeytpG6hcbiN9ZEF3zxA=; b=UZ9jd4cL5N+QIwV68VAXDfbaIEmvgz0kDrvnprAIPJiZJBCrW0UtnaHgrQQkciklXSD/1/OP4I0jLXOYwz8zCHcpTCEkWy3h6ClSgWKIcMy8s3uHU2LlpVuk0cW9z4IK0BnICKFJQLsqBAXtyK/87r2rVVQsNqvwLfcJRrrzEXw= 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 1591343052905735.3526185877063; Fri, 5 Jun 2020 00:44:12 -0700 (PDT) Received: from localhost ([::1]:39638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jh71P-0001Qs-KB for importer@patchew.org; Fri, 05 Jun 2020 03:44:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jh6xn-0002Mk-Tc for qemu-devel@nongnu.org; Fri, 05 Jun 2020 03:40:27 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:36215 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 1jh6xn-00056F-0D for qemu-devel@nongnu.org; Fri, 05 Jun 2020 03:40:27 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-252-5werW9iVPiGc5zPQt0IUEA-1; Fri, 05 Jun 2020 03:40:22 -0400 Received: by mail-wr1-f69.google.com with SMTP id l1so3408857wrc.8 for ; Fri, 05 Jun 2020 00:40:21 -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 y80sm11319660wmc.34.2020.06.05.00.40.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 00:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591342826; 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=VFGkz0p8Ozik1u5VT2fQxUZYeytpG6hcbiN9ZEF3zxA=; b=WLEyhzRMeLGDfqXXzaqaY5USTyPgUs9N1GxMk1tPwM+5BefD8HFEFLszi8HVyo5342L4ZO vWJCH9g8PEG2JDRmkU10CANIV1gMIwUnk/gagPNB3j844KIAe1NTGGhJ1ibYsOQNTBIa+8 CluF+3QS2f8M9AX3TNqGS4sZW/kAIsE= X-MC-Unique: 5werW9iVPiGc5zPQt0IUEA-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=VFGkz0p8Ozik1u5VT2fQxUZYeytpG6hcbiN9ZEF3zxA=; b=UrbxV8YP+V9omW56qWAfb6vB1Jdn4qFLjfXnwoeZQ9WaTWTDgP+xrWnWJokykHcHzN JN246MS8U50pi0YZ5vViYMKgSsoQGibmDqSZsTcEFNYyl6ZFKVAAxaSl2JML1qgtUsvA 3fr9wkoZ5oxJ5i6ypqhYKQXdysagd+xANEIdMzQRBbD2JlReybtCz9bvRbmh8XsoLVFQ FNCRdupQnWOCYq4lDW7ztrvLKcQ1GCdSEDZaRUuz2b9mE70PZj+1ZtOdgK6HLFWhFMe8 E4y4zSXpc20DRlfmvvxxrJZYWtt50GEJ1MXIe1hKRQSjtSpwJXcJK18a57DXybreI63r sQUw== X-Gm-Message-State: AOAM533L4xBjtvR4/0Sk7W5+f36Vi0sZDqgvRaKaAD6rJo7qm0gUsbHF VbMASltsH3nhCyBGQQENTcRibNjwR+ofiPZbs+OynO3bINevkKwb9nx6Ie6u4fG+4w6l8cYwCGa r+31AVDgOXh4fiGg= X-Received: by 2002:adf:8b55:: with SMTP id v21mr8608978wra.187.1591342820778; Fri, 05 Jun 2020 00:40:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN19mIF1iE06AjpBLrNf8TYxvvfAjsvWZfF2+UGLaRVmFFmTavxzcT1AozrLBvY7ca1KvWHg== X-Received: by 2002:adf:8b55:: with SMTP id v21mr8608965wra.187.1591342820560; Fri, 05 Jun 2020 00:40:20 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v5 05/11] rules.mak: Add base-arch() rule Date: Fri, 5 Jun 2020 09:39:47 +0200 Message-Id: <20200605073953.19268-6-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200605073953.19268-1-philmd@redhat.com> References: <20200605073953.19268-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 --- v5: - risc -> riscv (rth) - use strequal (rth) - add microblaze/sh4/xtensa v4: - use startwith() - fix openrisc (rth) --- rules.mak | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/rules.mak b/rules.mak index ccc1c49604..907f9aca91 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 startwith,aarch64,$1),arm,\ + $(if $(call startwith,arm,$1),arm,\ + $(if $(call startwith,microblaze,$1),microblaze,\ + $(if $(call startwith,mips,$1),mips,\ + $(if $(call startwith,ppc,$1),ppc,\ + $(if $(call startwith,riscv,$1),riscv,\ + $(if $(call startwith,sh4,$1),sh4,\ + $(if $(call startwith,sparc,$1),sparc,\ + $(if $(call startwith,xtensa,$1),xtensa,\ + $(if $(call strequal,x86_64,$1),i386,\ + $1\ + )\ + )\ + )\ + )\ + )\ + )\ + )\ + )\ + )\ + )\ + ) + +print-base-arch-%: + @echo '$*=3D$(call base-arch,$*)' --=20 2.21.3