diff mbox series

[v2,1/4] classes/nativesdk: also override TUNE_PKGARCH

Message ID 20250110180331.2537602-1-ross.burton@arm.com
State Accepted, archived
Commit 05322beb290e1db30bef49b4364f8a8e6e9f7408
Headers show
Series [v2,1/4] classes/nativesdk: also override TUNE_PKGARCH | expand

Commit Message

Ross Burton Jan. 10, 2025, 6:03 p.m. UTC
The nativesdk class overrides PACKAGE_ARCH and unsets TUNE_FEATURES, but
as recipes might want to look at TUNE_PKGARCH too (for example, when
setting QEMU_EXTRAOPTIONS) we should also override that variable.

Otherwise, a nativesdk recipe will have the TUNE_PKGARCH of the target,
which leads to errors (eg passing mips arguments to an arm qemu).

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/classes-recipe/nativesdk.bbclass | 1 +
 1 file changed, 1 insertion(+)

Comments

Etienne Cordonnier May 20, 2025, 4:29 p.m. UTC | #1
Hi,
I was using TUNE_PKGARCH to retrieve the architecture of the final embedded
target, in a nativesdk recipe which only creates a cmake file pointing to
the right sysroot path (cmake toolchain file). This obviously stopped
working with this patch, however I'm not sure what the clean way to fix
this is.

Do I understand correctly that any recipe which needs to be aware of the
actual target architecture should inherit cross-canadian.bbclass instead
of nativesdk.bbclass? Or should I add something like
"TARGET_ACTUAL_PKGARCH" to nativesdk.bbclass?

Thanks,
Étienne

On Fri, Jan 10, 2025 at 7:06 PM Ross Burton via lists.openembedded.org
<ross.burton=arm.com@lists.openembedded.org> wrote:

> The nativesdk class overrides PACKAGE_ARCH and unsets TUNE_FEATURES, but
> as recipes might want to look at TUNE_PKGARCH too (for example, when
> setting QEMU_EXTRAOPTIONS) we should also override that variable.
>
> Otherwise, a nativesdk recipe will have the TUNE_PKGARCH of the target,
> which leads to errors (eg passing mips arguments to an arm qemu).
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  meta/classes-recipe/nativesdk.bbclass | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta/classes-recipe/nativesdk.bbclass
> b/meta/classes-recipe/nativesdk.bbclass
> index b0634de5829..4e57349aa08 100644
> --- a/meta/classes-recipe/nativesdk.bbclass
> +++ b/meta/classes-recipe/nativesdk.bbclass
> @@ -32,6 +32,7 @@ RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot"
>  #
>  PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
>  PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}"
> +TUNE_PKGARCH = "${SDK_ARCH}"
>
>  #
>  # We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
> --
> 2.43.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#209660):
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.openembedded.org_g_openembedded-2Dcore_message_209660&d=DwIFaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=WUka6gPzHbL9TE5ZAoD4BQvCgcMYKkOu1IrPrjksrmUBAk0vuk3BpV1t8oaEwTyf&s=TPtFgHj79RNEq6iL3Uxa01OjFr0K74vmPh3nxxZZQZY&e=
> Mute This Topic:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.openembedded.org_mt_110539749_7048771&d=DwIFaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=WUka6gPzHbL9TE5ZAoD4BQvCgcMYKkOu1IrPrjksrmUBAk0vuk3BpV1t8oaEwTyf&s=mifiNwos_7bKHeewrpcqyuofX-FvX7RPlxDhY5ySxfE&e=
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.openembedded.org_g_openembedded-2Dcore_unsub&d=DwIFaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=WUka6gPzHbL9TE5ZAoD4BQvCgcMYKkOu1IrPrjksrmUBAk0vuk3BpV1t8oaEwTyf&s=UJRePpE8mfPKpZE3UsDr_Y1qxcxp6nZVq7rHvR5YqXc&e=
> [ecordonnier@snap.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Peter Kjellerstedt May 29, 2025, 8:57 p.m. UTC | #2
Yes, I believe switching to cross-canadian is the correct thing to do. We also had a nativesdk recipe that relied on ${TUNE_PKGARCH} being set to the target architecture, and I had to rewrite it to use cross-canadian due to the change below.

//Peter

From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Etienne Cordonnier via lists.openembedded.org
Sent: den 20 maj 2025 18:29
To: ross.burton@arm.com
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 1/4] classes/nativesdk: also override TUNE_PKGARCH

Hi,
I was using TUNE_PKGARCH to retrieve the architecture of the final embedded target, in a nativesdk recipe which only creates a cmake file pointing to the right sysroot path (cmake toolchain file). This obviously stopped working with this patch, however I'm not sure what the clean way to fix this is.

Do I understand correctly that any recipe which needs to be aware of the actual target architecture should inherit cross-canadian.bbclass instead of nativesdk.bbclass? Or should I add something like "TARGET_ACTUAL_PKGARCH" to nativesdk.bbclass?

Thanks,
Étienne

On Fri, Jan 10, 2025 at 7:06 PM Ross Burton via lists.openembedded.org<http://lists.openembedded.org> <ross.burton=arm.com@lists.openembedded.org<mailto:arm.com@lists.openembedded.org>> wrote:
The nativesdk class overrides PACKAGE_ARCH and unsets TUNE_FEATURES, but
as recipes might want to look at TUNE_PKGARCH too (for example, when
setting QEMU_EXTRAOPTIONS) we should also override that variable.

Otherwise, a nativesdk recipe will have the TUNE_PKGARCH of the target,
which leads to errors (eg passing mips arguments to an arm qemu).

Signed-off-by: Ross Burton <ross.burton@arm.com<mailto:ross.burton@arm.com>>
---
 meta/classes-recipe/nativesdk.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes-recipe/nativesdk.bbclass b/meta/classes-recipe/nativesdk.bbclass
index b0634de5829..4e57349aa08 100644
--- a/meta/classes-recipe/nativesdk.bbclass
+++ b/meta/classes-recipe/nativesdk.bbclass
@@ -32,6 +32,7 @@ RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot"
 #
 PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
 PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}"
+TUNE_PKGARCH = "${SDK_ARCH}"

 #
 # We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
--
2.43.0
diff mbox series

Patch

diff --git a/meta/classes-recipe/nativesdk.bbclass b/meta/classes-recipe/nativesdk.bbclass
index b0634de5829..4e57349aa08 100644
--- a/meta/classes-recipe/nativesdk.bbclass
+++ b/meta/classes-recipe/nativesdk.bbclass
@@ -32,6 +32,7 @@  RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot"
 #
 PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
 PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}"
+TUNE_PKGARCH = "${SDK_ARCH}"
 
 #
 # We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit