From patchwork Mon Apr 7 21:29:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Murray X-Patchwork-Id: 60904 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 54F99C369A7 for ; Mon, 7 Apr 2025 21:30:44 +0000 (UTC) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by mx.groups.io with SMTP id smtpd.web10.60113.1744061441637380742 for ; Mon, 07 Apr 2025 14:30:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@konsulko.com header.s=google header.b=K7tr6ktg; spf=pass (domain: konsulko.com, ip: 209.85.166.52, mailfrom: scott.murray@konsulko.com) Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-86135aeca58so60950539f.0 for ; Mon, 07 Apr 2025 14:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1744061441; x=1744666241; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Y6vZnnD/d90l/pDiHfGeIGmXdEh8x/mLPRHHvImReeI=; b=K7tr6ktg+ma49dmY8wLRWFrIGXJ6LR4J7FNZcSTanIvPIgMhthSQkTvk8uN4cpSCrq QOUbWgxn0g/zq8MZLXU+EdTqFI/yNN4PKBjGt/3oTS20W512+FlSw+JtARuH+pyZOzg0 zHXMht0O1DoZgExFOVyLQygULZOVZ5R9cYkJQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744061441; x=1744666241; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from: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azQxQBeNjRrIES2+Pa0RQ== X-Received: by 2002:a05:6602:29a9:b0:85b:46b5:6fb5 with SMTP id ca18e2360f4ac-8611c3ba34cmr1390830639f.11.1744061440585; Mon, 07 Apr 2025 14:30:40 -0700 (PDT) Received: from ghidorah.spiteful.org (107-179-213-3.cpe.teksavvy.com. [107.179.213.3]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4f4f44ba91dsm132936173.79.2025.04.07.14.30.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Apr 2025 14:30:39 -0700 (PDT) From: Scott Murray To: yocto-patches@lists.yoctoproject.org Subject: [meta-lts-mixins][scarthgap/rust][PATCH 03/29] rust-cross-canadian: set CC_ for nativesdk Date: Mon, 7 Apr 2025 17:29:52 -0400 Message-ID: <2f64f98a144b64588096d8af6b1683ffc9cbe0ca.1744061149.git.scott.murray@konsulko.com> X-Mailer: git-send-email 2.49.0 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 ; Mon, 07 Apr 2025 21:30:44 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/1303 From: Sean Nyekjaer This fixes build errors when building rust bindings for C dependencies for the sdk host. This will allow us to build and run rust programs on the sdk host. Before: % cargo build --target x86_64-oesdk-linux-gnu -vv [...] Compiling zstd-sys v2.0.13+zstd.1.5.6 (zstd-rs/zstd-safe/zstd-sys) [zstd-sys 2.0.13+zstd.1.5.6] CC_x86_64-oesdk-linux-gnu = None [zstd-sys 2.0.13+zstd.1.5.6] CC = Some(arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/usr/local/sdk/sysroots/cortexa7t2hf-neon-oe-linux-gnueabi) [zstd-sys 2.0.13+zstd.1.5.6] cargo:warning=ToolExecError: Command LC_ALL="C" "arm-oe-linux-gnueabi-gcc" "-mthumb" "-mfpu=neon" "-mfloat-abi=hard" "-mcpu=cortex-a7" "-D_TIME_BITS=64" "-D_FILE_OFFSET_BITS=64" "--sysroot=/usr/local/cc-sdk/sysroots/cortexa7t2hf-neon-oe-linux-gnueabi" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-O2" "-pipe" "-g" "-feliminate-unused-debug-types" "-flto" "-ffat-lto-objects" "-fuse-linker-plugin" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "zstd-rs/target/x86_64-oesdk-linux-gnu/debug/build/zstd-sys-b2560022e172eec3/out/44ff4c55aa9e5133-debug.o" "-c" "zstd/lib/common/debug.c" with args arm-oe-linux-gnueabi-gcc did not execute successfully (status code exit status: 1).cargo:warning=arm-oe-linux-gnueabi-gcc: error: unrecognized command-line option '-m64' After: % cargo build --target x86_64-oesdk-linux-gnu -vv [...] Compiling zstd-sys v2.0.13+zstd.1.5.6 (zstd-rs/zstd-safe/zstd-sys) [zstd-sys 2.0.13+zstd.1.5.6] CC_x86_64_oesdk_linux_gnu = Some(x86_64-oesdk-linux-gcc) [...] Compiling zstd v0.13.2 (zstd-rs) Finished dev [unoptimized + debuginfo] target(s) in 14.67s Signed-off-by: Sean Nyekjaer Signed-off-by: Mathieu Dubois-Briand (adapted from oe-core commit 3c8fedd6e5a3251b7a7a73cc92b153d8e68cb8e5) Signed-off-by: Scott Murray --- recipes-devtools/rust/rust_1.81.0.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes-devtools/rust/rust_1.81.0.bb b/recipes-devtools/rust/rust_1.81.0.bb index 4efdcff..f54a497 100644 --- a/recipes-devtools/rust/rust_1.81.0.bb +++ b/recipes-devtools/rust/rust_1.81.0.bb @@ -277,10 +277,12 @@ rust_do_install:class-nativesdk() { mkdir "${ENV_SETUP_DIR}" RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/rust.sh" RUST_HOST_TRIPLE=`echo ${RUST_HOST_SYS} | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'` + RUST_HOST_CC=`echo ${RUST_HOST_SYS} | sed 's/-/_/g'` SDKLOADER=${@bb.utils.contains('SDK_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'i686', 'ld-linux.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'aarch64', 'ld-linux-aarch64.so.1', '', d)}${@bb.utils.contains('SDK_ARCH', 'ppc64le', 'ld64.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'riscv64', 'ld-linux-riscv64-lp64d.so.1', '', d)} cat <<- EOF > "${RUST_ENV_SETUP_SH}" export CARGO_TARGET_${RUST_HOST_TRIPLE}_RUNNER="\$OECORE_NATIVE_SYSROOT/lib/${SDKLOADER}" + export CC_$RUST_HOST_CC="${CCACHE}${HOST_PREFIX}gcc" EOF }