From patchwork Thu Jun 18 12:33:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 191099 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp1380851ilo; Thu, 18 Jun 2020 05:38:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhLNmwIOS6+Zm/K9Yk6noPYXc8xC7FUPlz25TuQYbWB38aeyOiPgajwnxDfB2SFisMXXdy X-Received: by 2002:a25:cc50:: with SMTP id l77mr5891929ybf.53.1592483899067; Thu, 18 Jun 2020 05:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592483899; cv=none; d=google.com; s=arc-20160816; b=pMIA6HFkG/KIEOr1CsOSPrN0jLn4jYFpDnXdN26hMIXh+UV9CaRyiAIXoV1JMu1EaJ 2r1lyrfDgUE7o8OEUfN4q8DjPmy5RKASUhY1FELaZkyWuftVQS+Q3UvkYXzp/jVUos5d +WNwuTWE/VDOa2bL7FzcxldjTyD3iRXpkH4jml56s+t+aJDobB32ZtFdc1o6EgCFOHHC TuZQFufsIaJXC2mi9x1CBXu6lWbiYbtXZGTg3BSjtn9YvPvRxU11woPYYkSJCwGCMe4Q D8zwuUh5tVv24b8CaVE9Fse5bXEZQyuG9I1hU40mfiw30R1aeqMPW7VeLYqXFNSZKylW xozQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=qGm35NS9TNX7NuxVc5/FgVKm25dd/CU0oP9YFDrfAng=; b=dCgZczFaYaFMk7qOFmDuwoHlvbU7yQhhTv949uLDoFJ7bsTSdlYF5JI1XU3LrbtbjE LMuD1X8XZMttWXfwARgR6wVzuU7wD8cZjLD7u+prmDlJvkwHsInpJJVNydf2QGYFKZyR U/tv7kUcqxjd1xFG7xiWjykIfSXTA1aNi3C8hzTmjKevK5qd5Vjvij5cIMeRub81nBaE 5134Oi6e4+IlQEl0bj/rY9V/URUbmwH67qDXM2YEIGoXraSI3SXWDk5aHXNm11loSXlj VFuKFcC4J/ZQxD4ISpcXCfLcxiXbywq4IJk/qZfZQu0STx0l1rkFFlGZBia9zPb/CPj5 +w1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=SuMfU9lr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o2si2324354ybq.107.2020.06.18.05.38.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jun 2020 05:38:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=SuMfU9lr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:34910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jltoA-0003KL-Ep for patch@linaro.org; Thu, 18 Jun 2020 08:38:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jltkB-0004Om-QM for qemu-devel@nongnu.org; Thu, 18 Jun 2020 08:34:11 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:27904 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 1jltkA-0004mI-3v for qemu-devel@nongnu.org; Thu, 18 Jun 2020 08:34:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592483649; 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=qGm35NS9TNX7NuxVc5/FgVKm25dd/CU0oP9YFDrfAng=; b=SuMfU9lrBTBjHT28wHKPxuZLINzsCr+V5yYm6e1tF9J6zhgZgTH0j2kyNDkzSuf07CNQeF SyChXAUsBLPP7yNs/rchEUdzzXN9qHzZj7TY9hHAYg4Z/EKiZ/oMqA9jdzLZ1eZHYLqona rr5tEc/uRr94iZilG69ZSw6+CkwBegU= 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-194-gbxQFzL4PiGlBvycm5HSpA-1; Thu, 18 Jun 2020 08:34:05 -0400 X-MC-Unique: gbxQFzL4PiGlBvycm5HSpA-1 Received: by mail-wr1-f69.google.com with SMTP id w4so2750760wrl.13 for ; Thu, 18 Jun 2020 05:34:05 -0700 (PDT) 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=qGm35NS9TNX7NuxVc5/FgVKm25dd/CU0oP9YFDrfAng=; b=ozbRlJ1QF+2KI40h8/MuxBKP+Mmy2CEWTxn0F1Q6pT0ayuxUoUxd2rHYDTWyO7ioIO 5SkCRw53GwiiC1vd4r4hxQMtQHK1cUAxoipTEcV+ciEBnF2Z2SzXz6Wqmk03DGwGmC3v 03B9YlqT5xSwn1EXOryLT6Uig+vEvMGbrsPM0rGRYl2RsEA69Kx+W9KUmPJ3pE8gojGZ +DpGHm7TdiECZ4nRIfD74Ijlcli+UphmiwJfyo0qkp0om5UUA4BE497Wi+8puSsJJleK H9OMiNoyWcns2DqC/ZhgbAzUr+/tHH0FDS+ohRC+m2tmhFsIl2TWwoCnMRbRasw1vE6T zAjQ== X-Gm-Message-State: AOAM530tJC09Nyq9uBZxFqvkBUN8RzT2j4pwv6iBq8C4kURqi+kRuTRP 3hVZ1EQxJ+/ZB/fUXpw7EU4sAQcPnUIvFfWfUJYv3T48LCdnNOyByoqwt2zoz4dRak1/JPRDCzW Z+tlMHrZgJd5I+zc= X-Received: by 2002:a05:6000:10cf:: with SMTP id b15mr4335089wrx.214.1592483643968; Thu, 18 Jun 2020 05:34:03 -0700 (PDT) X-Received: by 2002:a05:6000:10cf:: with SMTP id b15mr4335066wrx.214.1592483643748; Thu, 18 Jun 2020 05:34:03 -0700 (PDT) Received: from localhost.localdomain (93.red-83-59-160.dynamicip.rima-tde.net. [83.59.160.93]) by smtp.gmail.com with ESMTPSA id j14sm3465557wrs.75.2020.06.18.05.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2020 05:34:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v9 04/10] configure: Generate rule to calculate the base architecture of a target Date: Thu, 18 Jun 2020 14:33:36 +0200 Message-Id: <20200618123342.10693-5-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200618123342.10693-1-philmd@redhat.com> References: <20200618123342.10693-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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/18 01:21:16 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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_Mathieu-Daud?= =?utf-8?b?w6k=?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée As we encode the base architecture in configure.sh, we can emit the base-arch() function into config-host.mak. Signed-off-by: Alex Bennée Signed-off-by: Philippe Mathieu-Daudé --- configure | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 2.21.3 Reviewed-by: Philippe Mathieu-Daudé diff --git a/configure b/configure index ba88fd1824..c0d7fbc30e 100755 --- a/configure +++ b/configure @@ -7927,6 +7927,8 @@ if test "$linux" = "yes" ; then fi fi +target_to_base_map="" + for target in $target_list; do target_dir="$target" config_target_mak=$target_dir/config-target.mak @@ -8155,6 +8157,7 @@ target_arch_name="$(upper $TARGET_ARCH)" echo "TARGET_$target_arch_name=y" >> $config_target_mak echo "TARGET_NAME=$target_name" >> $config_target_mak echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak +target_to_base_map="$target_dir,$TARGET_BASE_ARCH $target_to_base_map" if [ "$TARGET_ABI_DIR" = "" ]; then TARGET_ABI_DIR=$TARGET_ARCH fi @@ -8370,6 +8373,22 @@ if test "$ccache_cpp2" = "yes"; then echo "export CCACHE_CPP2=y" >> $config_host_mak fi +# Export a rule for calculating base arch from target_dir for use by +# the Kconfig generator +echo "# Usage: \$(call base-arch, target-dir)" >> $config_host_mak +echo "# Return the base architecture for a target." >> $config_host_mak +echo "# e.g \$(call base-arch, aarch64-linux-user) returns 'arm'" >> $config_host_mak +echo "base-arch = \$(strip \\" >> $config_host_mak +close_braces="" +for pairs in $target_to_base_map +do + dir="${pairs%%,*}" + base="${pairs#*,}" + echo "\$(if \$(findstring $dir,\$1),$base, \\" >> $config_host_mak + close_braces="$close_braces )" +done +echo "$close_braces )" >> $config_host_mak + # If we're using a separate build tree, set it up now. # DIRS are directories which we simply mkdir in the build tree; # LINKS are things to symlink back into the source tree