From patchwork Sat Jul 23 11:10:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 10544 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32928CCA483 for ; Sat, 23 Jul 2022 11:10:53 +0000 (UTC) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mx.groups.io with SMTP id smtpd.web08.5150.1658574649363512947 for ; Sat, 23 Jul 2022 04:10:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Xt/iyxLm; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.54, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f54.google.com with SMTP id l15so5567728wro.11 for ; Sat, 23 Jul 2022 04:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=tlGea58qS3qP9mLek7eDrOC3/fXBJlIt5unSJhUpD04=; b=Xt/iyxLmvwy1luXB78SuOm9+Q4phyHCWxTU7uYIg7sDMNozP7irygow3XHVcwHAJgy Pn+tt50TkJMUShZ/jzozRJUIkUsJWWK/06FGs0AKgqEhyQ+k2S4pKUr+CVybUl+MvvYy G1OGgkBEPrInHeYN2PrIXlIZO2Lqq424F36jw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=tlGea58qS3qP9mLek7eDrOC3/fXBJlIt5unSJhUpD04=; b=meooJqE26GbAnFVtjN2ArLq5WC9Wb2YKZrbG0l2nUZgGgxeSJ/bx+EIZvNvcJQbxfN KSHV9lXpw+oag9wnKthvStPG8eDeovaA7SnpQbb7H7Uz3urdFUmhmqUtdirkT+ne2yGD PwVxFwGycsf80qKK3e/4LIO3eysoJGi4wnTRIsDyoP5Wcpg7VCRCSw14Q2zWOoqw7lDn tDV3sMCXBcEZb9EzvOfy4tPqVZStPdlUZTlNxX7F9lO4h8GVb8KGKSFT8gz1sxJ5wzkg tB78tXlulYCOuU5U1lsWYG4paoL+UyaoMVJNLVw3aSXb3HTv8HEbB6gvYYKLbagkmXgL VFyw== X-Gm-Message-State: AJIora9tphMQO8UGWjfAr+A1QL5ESvHGrX0lunZI8mIyWHXuMIOMPDS4 gEuNamWupKzRIgOuE6mtFdkAuP3GtQ9FaA== X-Google-Smtp-Source: AGRyM1tMWVEBSz9iYP7CYMVMqt/9eXqn1Mhykxk/r9mZQ3RTwkwxJEPAcGXAQ/+2R9Fz00W9i43WRA== X-Received: by 2002:a5d:6b50:0:b0:21e:298c:caad with SMTP id x16-20020a5d6b50000000b0021e298ccaadmr2483819wrw.509.1658574647272; Sat, 23 Jul 2022 04:10:47 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:9bb3:b62f:20a1:a32]) by smtp.gmail.com with ESMTPSA id f5-20020adff445000000b0021e5f32ade7sm3430181wrp.68.2022.07.23.04.10.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 04:10:46 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/4] rust-common: Set llvm-target correctly for cross SDK targets Date: Sat, 23 Jul 2022 12:10:42 +0100 Message-Id: <20220723111045.1775562-1-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 23 Jul 2022 11:10:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168429 When a 'BUILD' target is requested we shouldn't be looking at TARGET_SYS but at BUILD_SYS. Due to the way rust mangles triplets, we need the HOST_SYS triplet to work with existing code - fixing that issue is a separate patch. Also drop the arch_abi argument, it doens't make any sense to a getVar() call and was a copy and paste error. Based on a patch from Otavio Salvador but separated out and tweaked. Fixes: bd36593ba3 ("rust-common: Drop LLVM_TARGET and simplify") Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust-common.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meta/recipes-devtools/rust/rust-common.inc b/meta/recipes-devtools/rust/rust-common.inc index ef70c48d0f4..37abd2cd26d 100644 --- a/meta/recipes-devtools/rust/rust-common.inc +++ b/meta/recipes-devtools/rust/rust-common.inc @@ -307,9 +307,13 @@ def rust_gen_target(d, thing, wd, features, cpu, arch, abi=""): features = features or d.getVarFlag('FEATURES', arch_abi) or "" features = features.strip() + llvm_target = d.getVar('RUST_TARGET_SYS') + if thing == "BUILD": + llvm_target = d.getVar('RUST_HOST_SYS') + # build tspec tspec = {} - tspec['llvm-target'] = d.getVar('RUST_TARGET_SYS', arch_abi) + tspec['llvm-target'] = llvm_target tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch_abi) tspec['max-atomic-width'] = int(d.getVarFlag('MAX_ATOMIC_WIDTH', arch_abi)) tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi) From patchwork Sat Jul 23 11:10:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 10546 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 464CECCA489 for ; Sat, 23 Jul 2022 11:10:53 +0000 (UTC) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.groups.io with SMTP id smtpd.web08.5151.1658574649859083794 for ; Sat, 23 Jul 2022 04:10:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=IlF/HhmI; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.50, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f50.google.com with SMTP id a18-20020a05600c349200b003a30de68697so5991718wmq.0 for ; Sat, 23 Jul 2022 04:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=2PO4y4L65vjtecf7C04hyEc+h3mKKYvgvQW7iGJpBgs=; b=IlF/HhmImAa44CSH6cZ/TyCLfMqo6lsBMfXZOUTEtI404MekVsKVI2CESoKZN13A7P TzqpmJDynaW4vBAaXxGgih1eLxdQ4fA5FVY3Or5mkahA/t5fbbPSt0JZtMKIC8jvlJXr sL1/grlLzFJqB9/1i1bD8CQjyM6y/w0qxSAb8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2PO4y4L65vjtecf7C04hyEc+h3mKKYvgvQW7iGJpBgs=; b=wqQr7Cz/a012Zns1mtz9bDFnhG/KQbzFzIOezBNLmCXg7BYUm4HoQB3JXrtCCLp0+7 bMUT7AV1hNY9MOr/iFOi6vu4+C+RP/9rl8qgydrgG74noQbNNnWKgdOhB/wlxSuGa4ie TkQ3M43AIM4DB8e11hQGc9ybAJhMQzzRNTB9LCjb1yV7f71PFZnh1q8QXIO7XkI6adhC oF0ziexqcBXKviAsagc8p2uLM02WccrQ5txrLWPjOT+Whz3D0VKrrnfUSyAKySqEiwoM mgpC0eNrIDJ9z5VYowYFSTfKYo/VFueqNXAqC5hYrkOqyRNfFK/ppGPm6nu6+AOdS1g8 djsA== X-Gm-Message-State: AJIora+MDa3G9pAAKu2xHwj44SwYomJ14Sh2nF91+D4YXw9qpNLduXTK mqxJmSKR6whlRjOSOILpTOv3DG1LkPmvlA== X-Google-Smtp-Source: AGRyM1skaG1VryYpWmF++cRP/EiGyab+0SS7WSk49Nu0wrZ+iOJwwBHyfq18KlH9aV/rlNT46M6bpw== X-Received: by 2002:a7b:ca57:0:b0:3a3:205d:2533 with SMTP id m23-20020a7bca57000000b003a3205d2533mr15044272wml.67.1658574647920; Sat, 23 Jul 2022 04:10:47 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:9bb3:b62f:20a1:a32]) by smtp.gmail.com with ESMTPSA id f5-20020adff445000000b0021e5f32ade7sm3430181wrp.68.2022.07.23.04.10.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 04:10:47 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/4] rust-cross-canadian: Fix ordering of target json config generation Date: Sat, 23 Jul 2022 12:10:43 +0100 Message-Id: <20220723111045.1775562-2-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220723111045.1775562-1-richard.purdie@linuxfoundation.org> References: <20220723111045.1775562-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 23 Jul 2022 11:10:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168430 Based upon a patch from Otavio Salvador , ensure the target json files are written in the correct order with the most specific last incase it overwrites earlier files if the prefixes match. Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust-cross-canadian-common.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meta/recipes-devtools/rust/rust-cross-canadian-common.inc b/meta/recipes-devtools/rust/rust-cross-canadian-common.inc index 1f21c8af26e..df4901f1fac 100644 --- a/meta/recipes-devtools/rust/rust-cross-canadian-common.inc +++ b/meta/recipes-devtools/rust/rust-cross-canadian-common.inc @@ -27,9 +27,10 @@ DEBUG_PREFIX_MAP = "-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDP python do_rust_gen_targets () { wd = d.getVar('WORKDIR') + '/targets/' - rust_gen_target(d, 'TARGET', wd, d.getVar('TARGET_LLVM_FEATURES') or "", d.getVar('TARGET_LLVM_CPU'), d.getVar('TARGET_ARCH')) - rust_gen_target(d, 'HOST', wd, "", "generic", d.getVar('HOST_ARCH')) + # Order of BUILD, HOST, TARGET is important in case the files overwrite, most specific last rust_gen_target(d, 'BUILD', wd, "", "generic", d.getVar('BUILD_ARCH')) + rust_gen_target(d, 'HOST', wd, "", "generic", d.getVar('HOST_ARCH')) + rust_gen_target(d, 'TARGET', wd, d.getVar('TARGET_LLVM_FEATURES') or "", d.getVar('TARGET_LLVM_CPU'), d.getVar('TARGET_ARCH')) } INHIBIT_DEFAULT_RUST_DEPS = "1" From patchwork Sat Jul 23 11:10:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 10545 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30A96C433EF for ; Sat, 23 Jul 2022 11:10:53 +0000 (UTC) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.web08.5152.1658574650749000937 for ; Sat, 23 Jul 2022 04:10:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=iVhvxSsg; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.52, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f52.google.com with SMTP id i205-20020a1c3bd6000000b003a2fa488efdso794322wma.4 for ; Sat, 23 Jul 2022 04:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=yXx+J9FeYsAw1qmCuz8Nvi9o7JrAqJaD4Bif0vFAGDw=; b=iVhvxSsgAYMJq1cd5DJGhd8Dj5DFCV2t8pUmIi+llQkaGCxw4PpzTH71tQgAGbSgOW Cnv6rPLR2FYmJ2mtLStsoPkJNCuQuODCaeUmCaezNcUVngjWclaI/NoY1w9CSISVLtbZ rrbAqj6aqrpgJwSLqW7yUpL43lX1IDjhNychM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yXx+J9FeYsAw1qmCuz8Nvi9o7JrAqJaD4Bif0vFAGDw=; b=tIRrgD5LcSeFhJskd2cWUsplVYe/q/9PCzvG8cIACalAWDwFwpKlfRKpb9ONt0bSdq 2mfbVvx6lvODY4y+TVm190nwFQkSf+5ptRm4w1cDN1odVKeIX81kapCttLGeEpId6ylv odH723vGSHr2d6DxWGMWChzBd56bkRaePvoSC/NuCQHYeNrJFfhezNlQDT0vjl9v1BOU m26jCDm9/T9kYQwf5MBuE/jK4hJQFDeGbTqQBFgE0SaeU7ZmV81u9WJnGijyDWCkDf2o zxNer3XCmEeYypqvlRis1Fc0Y2FRfeXVH/ozZBAB7mT1YxdFM5o+AaHhMW3J+GbvfTVR c7xA== X-Gm-Message-State: AJIora982jS6G2PPsQ9q5pAPysbmj2CSdY83+uUoP5k1gLlIQdUvXU3/ 41K/MGpQc0KzJgy+3KDVsuld7FK9AuXu/A== X-Google-Smtp-Source: AGRyM1uWjjKlB3bO5I6mdpP8fmiqrZETkbS66+/a35UIFaGjTkX+nH5TOXyZ6IHSof2EEI6qWvwwFQ== X-Received: by 2002:a1c:7707:0:b0:3a2:fedc:392 with SMTP id t7-20020a1c7707000000b003a2fedc0392mr2620354wmi.20.1658574648817; Sat, 23 Jul 2022 04:10:48 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:9bb3:b62f:20a1:a32]) by smtp.gmail.com with ESMTPSA id f5-20020adff445000000b0021e5f32ade7sm3430181wrp.68.2022.07.23.04.10.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 04:10:48 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 3/4] rust-cross/rust-common: Merge arm target handling code to fix cross-canadian Date: Sat, 23 Jul 2022 12:10:44 +0100 Message-Id: <20220723111045.1775562-3-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220723111045.1775562-1-richard.purdie@linuxfoundation.org> References: <20220723111045.1775562-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 23 Jul 2022 11:10:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168431 rust-cross had special handling for armv7 targets but we also need this for cross-canadian. Merge the code into the main function so everything is consistent. Also then fix the arm definition to be arm-eabi since ABI is correctly being looked up. Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust-common.inc | 6 ++++++ meta/recipes-devtools/rust/rust-cross.inc | 7 +------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/meta/recipes-devtools/rust/rust-common.inc b/meta/recipes-devtools/rust/rust-common.inc index 37abd2cd26d..82ff03b9089 100644 --- a/meta/recipes-devtools/rust/rust-common.inc +++ b/meta/recipes-devtools/rust/rust-common.inc @@ -297,6 +297,12 @@ def rust_gen_target(d, thing, wd, features, cpu, arch, abi=""): sys = sys_for(d, thing) prefix = prefix_for(d, thing) + if thing == "TARGET": + abi = d.getVar('ABIEXTENSION') + # arm and armv7 have different targets in llvm + if arch == "arm" and target_is_armv7(d): + arch = 'armv7' + rust_arch = oe.rust.arch_to_rust_arch(arch) if abi: diff --git a/meta/recipes-devtools/rust/rust-cross.inc b/meta/recipes-devtools/rust/rust-cross.inc index f6babfeedaa..4c026b1f388 100644 --- a/meta/recipes-devtools/rust/rust-cross.inc +++ b/meta/recipes-devtools/rust/rust-cross.inc @@ -8,15 +8,10 @@ python do_rust_gen_targets () { features = "" cpu = "generic" arch = d.getVar('{}_ARCH'.format(thing)) - abi = "" if thing is "TARGET": - abi = d.getVar('ABIEXTENSION') - # arm and armv7 have different targets in llvm - if arch == "arm" and target_is_armv7(d): - arch = 'armv7' features = d.getVar('TARGET_LLVM_FEATURES') or "" cpu = d.getVar('TARGET_LLVM_CPU') - rust_gen_target(d, thing, wd, features, cpu, arch, abi) + rust_gen_target(d, thing, wd, features, cpu, arch) } # Otherwise we'll depend on what we provide From patchwork Sat Jul 23 11:10:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 10547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 327AAC43334 for ; Sat, 23 Jul 2022 11:10:53 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.groups.io with SMTP id smtpd.web09.5337.1658574651462257693 for ; Sat, 23 Jul 2022 04:10:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=O3rhHIUD; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.43, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f43.google.com with SMTP id ay11-20020a05600c1e0b00b003a3013da120so6548120wmb.5 for ; Sat, 23 Jul 2022 04:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=7gMR912ql6d3XzGNkLBHmKEbKnE947RJPgWEWYrTaio=; b=O3rhHIUDGSfw+ScL9regAWd3TdSkrcfd9N2JzjDPqOKUYn/5fzxjjL0sTkHTufN4ka 9YjAzUWMWk4DDTbdPyxgmydNyNlE3ZFlz77s8pl03Er04gZ1+lraJV/4MJ98w+heT+Lv 8x3RO+N7zD37GajkcQI19EDb9Cx6VTLnFE8nQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7gMR912ql6d3XzGNkLBHmKEbKnE947RJPgWEWYrTaio=; b=DebnD8HxjGXfn6fF1QufJ8Npby2UwbaDhltsrWV8S+FjmEaPVpHpeiU82Mw9N8t8+D NY4ID8mFiB02EaXMRCHo7vHO4ClZ++AkXr9t23tvfLqgFdprAej+w0orHiTWpxhXtrgS YTawRMzoOCK+gxkzjDzdZkBhSFTIdaifuzs5aXR5JbCz/eHS2TcSOauyEj44G7FGWVlV O3B+jLqxGM2D/0O7FJqa3U6pd9AXqQ2JbrxaTqVUsAZ2W+7ZSNNBs2KB46l56LYTJaBX N/SvaAQBvEcZ6DuyCh6nwKzTRQ7gfdTlndeqtvkc+hp67X0toISY7atlPeNQPzJpaakM Ckxg== X-Gm-Message-State: AJIora9t5agRiIrkU/WxtitK6fxGE+dOkVWXsLASStyCtky4f6GnVLID Uh+KJdaJor9R3chku5jn48odKWSBVC1APQ== X-Google-Smtp-Source: AGRyM1sgOEdRFY7R5aDCN03j3AyhU+iYLi7u8TGdbhRXyyPC7O8E9tB0huO83juWj/j4SzYR7mOtXg== X-Received: by 2002:a7b:c442:0:b0:3a3:bdb:e84c with SMTP id l2-20020a7bc442000000b003a30bdbe84cmr2592189wmi.101.1658574649653; Sat, 23 Jul 2022 04:10:49 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:9bb3:b62f:20a1:a32]) by smtp.gmail.com with ESMTPSA id f5-20020adff445000000b0021e5f32ade7sm3430181wrp.68.2022.07.23.04.10.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 04:10:49 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 4/4] rust-cross: Simplfy the rust_gen_target calls Date: Sat, 23 Jul 2022 12:10:45 +0100 Message-Id: <20220723111045.1775562-4-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220723111045.1775562-1-richard.purdie@linuxfoundation.org> References: <20220723111045.1775562-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 23 Jul 2022 11:10:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168432 Match the code in rust-cross-canadian so that further simplifications can be considered in future. Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust-common.inc | 12 ++++++------ meta/recipes-devtools/rust/rust-cross.inc | 16 ++++------------ 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/meta/recipes-devtools/rust/rust-common.inc b/meta/recipes-devtools/rust/rust-common.inc index 82ff03b9089..d00b380dbde 100644 --- a/meta/recipes-devtools/rust/rust-common.inc +++ b/meta/recipes-devtools/rust/rust-common.inc @@ -119,12 +119,12 @@ def llvm_features(d): ## arm-unknown-linux-gnueabihf -DATA_LAYOUT[arm] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" -TARGET_ENDIAN[arm] = "little" -TARGET_POINTER_WIDTH[arm] = "32" -TARGET_C_INT_WIDTH[arm] = "32" -MAX_ATOMIC_WIDTH[arm] = "64" -FEATURES[arm] = "+v6,+vfp2" +DATA_LAYOUT[arm-eabi] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" +TARGET_ENDIAN[arm-eabi] = "little" +TARGET_POINTER_WIDTH[arm-eabi] = "32" +TARGET_C_INT_WIDTH[arm-eabi] = "32" +MAX_ATOMIC_WIDTH[arm-eabi] = "64" +FEATURES[arm-eabi] = "+v6,+vfp2" ## armv7-unknown-linux-gnueabihf DATA_LAYOUT[armv7-eabi] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" diff --git a/meta/recipes-devtools/rust/rust-cross.inc b/meta/recipes-devtools/rust/rust-cross.inc index 4c026b1f388..2e47a3aa5f3 100644 --- a/meta/recipes-devtools/rust/rust-cross.inc +++ b/meta/recipes-devtools/rust/rust-cross.inc @@ -1,17 +1,9 @@ python do_rust_gen_targets () { wd = d.getVar('WORKDIR') + '/targets/' - # It is important 'TARGET' is last here so that it overrides our less - # informed choices for BUILD & HOST if TARGET happens to be the same as - # either of them. - for thing in ['BUILD', 'HOST', 'TARGET']: - bb.debug(1, "rust_gen_target for " + thing) - features = "" - cpu = "generic" - arch = d.getVar('{}_ARCH'.format(thing)) - if thing is "TARGET": - features = d.getVar('TARGET_LLVM_FEATURES') or "" - cpu = d.getVar('TARGET_LLVM_CPU') - rust_gen_target(d, thing, wd, features, cpu, arch) + # Order of BUILD, HOST, TARGET is important in case the files overwrite, most specific last + rust_gen_target(d, 'BUILD', wd, "", "generic", d.getVar('BUILD_ARCH')) + rust_gen_target(d, 'HOST', wd, "", "generic", d.getVar('HOST_ARCH')) + rust_gen_target(d, 'TARGET', wd, d.getVar('TARGET_LLVM_FEATURES') or "", d.getVar('TARGET_LLVM_CPU'), d.getVar('TARGET_ARCH')) } # Otherwise we'll depend on what we provide