From mboxrd@z Thu Jan 1 00:00:00 1970 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 C8E49C624DA for ; Thu, 3 Sep 2026 18:40:27 +0000 (UTC) Subject: Re: [PATCH v3] rust: Avoid passing host-specific information to crates Strict Version Hash To: openembedded-core@lists.openembedded.org From: "Dora, Sunil Kumar" X-Originating-Location: Bengaluru, Karnataka, IN (106.51.217.239) X-Originating-Platform: Windows Chrome 151 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Thu, 03 Sep 2026 11:40:22 -0700 References: <20260826155417.2774608-1-alhe@linux.microsoft.com> <2326647.1787768749336187635@lists.openembedded.org> <69b11fc6-cffc-4b91-8853-c9ab277577c8@linux.microsoft.com> <18CF75EE37DB8543.642712@lists.openembedded.org> <78bca4cc9c3e7fd3014f22e1d1b9529480089a2a.camel@linuxfoundation.org> In-Reply-To: <78bca4cc9c3e7fd3014f22e1d1b9529480089a2a.camel@linuxfoundation.org> Message-ID: <3299883.1788460822003555425@lists.openembedded.org> Content-Type: multipart/alternative; boundary="fpmNHJOxuOuTTdMpgOgH" List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 03 Sep 2026 18:40:27 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/245039 --fpmNHJOxuOuTTdMpgOgH Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I'm still working through the remaining Rust packages and will follow up on= that separately. While going through the reproducible-cross diffoscope output, though, I not= iced something unrelated to Rust that I think may explain the git/git-dbg entries, so sharing it here in cas= e it's useful or helps narrow things down. In the 2026-07-29 report from builder 120 [1], git's .rodata has: -0x001b1780 6769742d 00000000 61617263 68363400 =C2=A0git-....aarch64. +0x001b1780 6769742d 00000000 7838365f 36340000 =C2=A0git-....x86_64.. i.e. the build host's arch string, sitting right next to git's "cpu: %s" fo= rmat string. git's Makefile does: ifeq (,$(HOST_CPU)) BASIC_CFLAGS +=3D -DGIT_HOST_CPU=3D"\"$(firstword $(subst -, ,$(uname_M)))\= "" else BASIC_CFLAGS +=3D -DGIT_HOST_CPU=3D"\"$(HOST_CPU)\"" endif uname_M comes from `uname -m` on the build machine, and GIT_HOST_CPU ends up in the "cpu:" line of `git version --build-options`. Upstream even documents HOST_CPU as the thing to set when cross compiling, but our recipe never sets it, so we always take the uname fallback. Since "aarch64" and "x86_64" have different lengths, everything after that = string shifts, which is why the git diffs look much bigger than they really are (.text, .s= ymtab and so on) - the instructions themselves don't change. git/git-dbg show up in every run = I've looked at (119/120/121, before and after the SVH fix, on both x86 and arm hosts), so it fits a build host leak rather than anything rust related. The fix should just be: EXTRA_OEMAKE +=3D "HOST_CPU=3D${TARGET_ARCH}" in git_2.55.0.bb. As far as I can tell TARGET_ARCH does the right thing for native (=3D BUILD_ARCH) and nativesdk (=3D SDK_ARCH) as well, so no class overrides needed. I'm cross checking with a locally to make sure the resulting binary really = says "aarch64", and will send the patch once that's confirmed. [1] https://valkyrie.yocto.io/pub/repro-fail/oe-reproducible-20260729-j6j_x= puw/packages/diff-html/ Thanks, Sunil --fpmNHJOxuOuTTdMpgOgH Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
I'm still working through the remaining Rust packages and will follow = up on that separately.

While going through the reproducible-cros= s diffoscope output, though, I noticed something unrelated to Rust
th= at I think may explain the git/git-dbg entries, so sharing it here in case = it's useful or helps narrow things down.

In the 2026-07-29 repor= t from builder 120 [1], git's .rodata has:

    -0x001b= 1780 6769742d 00000000 61617263 68363400  git-....aarch64.
 =   +0x001b1780 6769742d 00000000 7838365f 36340000  git-....x86_6= 4..

i.e. the build host's arch string, sitting right next to git= 's "cpu: %s" format string.

git's Makefile does:

&nb= sp;   ifeq (,$(HOST_CPU))
          &nbs= p; BASIC_CFLAGS +=3D -DGIT_HOST_CPU=3D"\"$(firstword $(subst -, ,$(uname_M)= ))\""
    else
           = ; BASIC_CFLAGS +=3D -DGIT_HOST_CPU=3D"\"$(HOST_CPU)\""
    e= ndif

uname_M comes from `uname -m` on the build machine, and GIT= _HOST_CPU
ends up in the "cpu:" line of `git version --build-options`= .

Upstream even documents HOST_CPU as the thing to set when cro= ss compiling,
but our recipe never sets it, so we always take the una= me fallback.

Since "aarch64" and "x86_64" have different lengths= , everything after that string shifts,
which is why the git diffs loo= k much bigger than they really are (.text, .symtab and so on) -
the i= nstructions themselves don't change. git/git-dbg show up in every run I've = looked
at (119/120/121, before and after the SVH fix, on both x86 and = arm hosts),
so it fits a build host leak rather than anything rust re= lated.

The fix should just be:

    EXTRA_OE= MAKE +=3D "HOST_CPU=3D${TARGET_ARCH}"

in git_2.55.0.bb. As far a= s I can tell TARGET_ARCH does the right
thing for native (=3D BUILD_AR= CH) and nativesdk (=3D SDK_ARCH) as well, so
no class overrides needed= .

I'm cross checking with a locally to make sure the resulting b= inary really says "aarch64", and will send the patch once
that's confi= rmed.

[1] https://valkyrie.yocto.io/pub/repro-fail/oe-reproducib= le-20260729-j6j_xpuw/packages/diff-html/

Thanks,
Sunil

--fpmNHJOxuOuTTdMpgOgH--