From patchwork Thu Jun 2 16:51:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 8775 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 E5669CCA47E for ; Thu, 2 Jun 2022 16:53:13 +0000 (UTC) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mx.groups.io with SMTP id smtpd.web09.1543.1654188788085768207 for ; Thu, 02 Jun 2022 09:53:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20210112.gappssmtp.com header.s=20210112 header.b=upRqRkmK; spf=softfail (domain: sakoman.com, ip: 209.85.216.53, mailfrom: steve@sakoman.com) Received: by mail-pj1-f53.google.com with SMTP id v11-20020a17090a4ecb00b001e2c5b837ccso9944390pjl.3 for ; Thu, 02 Jun 2022 09:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20210112.gappssmtp.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=m4ukp2ol2O1zxwZ5Zp8ndkxECH0I9fNk0qdLNWuC9zc=; b=upRqRkmK9mbaa00PKTl9R2T9R31q7E6VzmHyloK9df0w7m1+X607i9UJAiDiCfFDFw zA3RJXso0dFiXYA+7y/H6h5RM2bqKw5UR0G/Qk18ti3oxFbXaNHOCPZo196N9LHy7wQs rASCaKGqgG4upMjxjC0XAuqFmXoky35V1BgZd74rEzL91mvK74R1WvDK0hSZJ4KYo9nk d/Yx6jhONA0CBeIOiiSP64U3xiu9oe4GkYvEGAQ/BtxODJeSpKYqusmriEYXjiSSuwlY bXVHy1GC0ECjKrMuQVPRZ/FMoge25jCkusssOpZAEzqsQxAeyUEPFyx9OMu6w5/73QW+ L6VQ== 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=m4ukp2ol2O1zxwZ5Zp8ndkxECH0I9fNk0qdLNWuC9zc=; b=cUxTQGId89fYE2H14qnkyaIhGR26fZhm8lmO5BvoaQRFq5yck3EBKDfVpY11okHAaA Pv4hCLNQer+61nfSyk4CP084t0pbmOxEufF+8DfHIcdIaaj4xU6n6ISZmZ2UvchFzYfq YRUR8KBz8V6LyXvNjrfHRN8DZGaEyT7y7asl3bo4QPNZT8BoNU3ZcdpxOKIUX32kCjO+ c2w7DSHIMQLeTYri6oQ1bnvqyCzPnvyJIzrbrJKv6I47+OTA5P5+QY3or6xu9uJz+TMP TU7AQ4uKsmwwD4mKjFf0hIOXAqherZOLfIIGQzwf74VfJH5XU3O3Qze8KlzPekIP5t/c 7hDA== X-Gm-Message-State: AOAM533RaOo5sDrVMt1JxU2M71Zbd6KCzp7a1xj5ttOs2Cq+uTpLKBKj t2VMgC0FVAE9FfdbyQbIKNu418Vx8FpfKyJU X-Google-Smtp-Source: ABdhPJwccwNF0aXKzibtlL2QkQv6CuCIB6NypgDqu+M1uI3NzqH4/gs4pgHQ8eCNnFrZP0fA6r7lsw== X-Received: by 2002:a17:90a:5d03:b0:1e0:cc5b:4808 with SMTP id s3-20020a17090a5d0300b001e0cc5b4808mr6308574pji.180.1654188786791; Thu, 02 Jun 2022 09:53:06 -0700 (PDT) Received: from hexa.router0800d9.com (dhcp-72-253-6-214.hawaiiantel.net. [72.253.6.214]) by smtp.gmail.com with ESMTPSA id i188-20020a626dc5000000b0050dc762815asm3782233pfc.52.2022.06.02.09.53.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jun 2022 09:53:05 -0700 (PDT) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 23/26] rust-common: Fix for target definitions returning 'NoneType' for arm Date: Thu, 2 Jun 2022 06:51:55 -1000 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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 ; Thu, 02 Jun 2022 16:53:13 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/166500 From: Sundeep KOKKONDA [YOCTO #14742] The build shows below error while building for arm machines. Exception: TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' Detailed error info : Steps to reproduce: 1. Set MACHINE ?= "qemuarm" in local.conf & add 'TOOLCHAIN_HOST_TASK:append = " packagegroup-rust-cross-canadian-${MACHINE}"' 2. bitbake core-image-minimal -cpopulate_sdk Complete Error: ERROR: rust-cross-canadian-arm-1.59.0-r0 do_rust_gen_targets: Error executing a python function in exec_func_python() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_func_python() autogenerated', lineno: 2, function: 0001: *** 0002:do_rust_gen_targets(d) 0003: File: '/ala-lpggp31/skokkonda/yocto/poky/meta/recipes-devtools/rust/rust-cross-canadian-common.inc', lineno: 31, function: do_rust_gen_targets 0027: 0028:LLVM_TARGET[x86_64] = "${RUST_HOST_SYS}" 0029:python do_rust_gen_targets () { 0030: wd = d.getVar('WORKDIR') + '/targets/' *** 0031: rust_gen_target(d, 'TARGET', wd, d.getVar('TARGET_LLVM_FEATURES') or "", d.getVar('TARGET_LLVM_CPU'), d.getVar('TARGET_ARCH')) 0032: rust_gen_target(d, 'HOST', wd, "", "generic", d.getVar('HOST_ARCH')) 0033: rust_gen_target(d, 'BUILD', wd, "", "generic", d.getVar('BUILD_ARCH')) 0034:} 0035: File: '/ala-lpggp31/skokkonda/yocto/poky/meta/recipes-devtools/rust/rust-common.inc', lineno: 330, function: rust_gen_target 0326: # build tspec 0327: tspec = {} 0328: tspec['llvm-target'] = d.getVarFlag('LLVM_TARGET', arch_abi) 0329: tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch_abi) *** 0330: tspec['max-atomic-width'] = int(d.getVarFlag('MAX_ATOMIC_WIDTH', arch_abi)) 0331: tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi) 0332: tspec['target-c-int-width'] = d.getVarFlag('TARGET_C_INT_WIDTH', arch_abi) 0333: tspec['target-endian'] = d.getVarFlag('TARGET_ENDIAN', arch_abi) 0334: tspec['arch'] = arch_to_rust_target_arch(rust_arch) Exception: TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' Below are the local variables from rust_gen_target function for arm and aarch64 targets. Refer below, the tspec varibles for 'arm' generated with NoneType. (a) Locals at rust_gen_target for arm:: tspec['data-layout'] = None, Type of tspec['data-layout'] = tspec['data-layout'] = None, Type of tspec['data-layout'] = DEBUG: Python function do_rust_gen_targets finished (b) Locals at rust_gen_target for aarch64:: tspec['data-layout'] = aarch64-unknown-linux-gnu, Type of tspec['data-layout'] = tspec['max-atomic-width'] = 128, Type of tspec['max-atomic-width'] = Reason for changing arm-eabi to arm: The earlier changes introduced this bug, so reverting the change 'arm-eabi' to 'arm' fixed the issue. Signed-off-by: Sundeep KOKKONDA Signed-off-by: Richard Purdie (cherry picked from commit 8ed000debb026477abd86ea3bf72adaf21d69f39) Signed-off-by: Steve Sakoman --- meta/recipes-devtools/rust/rust-common.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/meta/recipes-devtools/rust/rust-common.inc b/meta/recipes-devtools/rust/rust-common.inc index 29b17cb955..984fe9099e 100644 --- a/meta/recipes-devtools/rust/rust-common.inc +++ b/meta/recipes-devtools/rust/rust-common.inc @@ -119,13 +119,13 @@ def llvm_features(d): ## arm-unknown-linux-gnueabihf -DATA_LAYOUT[arm-eabi] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" -LLVM_TARGET[arm-eabi] = "${RUST_TARGET_SYS}" -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" +DATA_LAYOUT[arm] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" +LLVM_TARGET[arm] = "${RUST_TARGET_SYS}" +TARGET_ENDIAN[arm] = "little" +TARGET_POINTER_WIDTH[arm] = "32" +TARGET_C_INT_WIDTH[arm] = "32" +MAX_ATOMIC_WIDTH[arm] = "64" +FEATURES[arm] = "+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"