diff mbox series

meson: use TRANSLATED_TARGET_ARCH in cross builds

Message ID 20230119121002.15819-1-s.zhmylev@yadro.com
State New
Headers show
Series meson: use TRANSLATED_TARGET_ARCH in cross builds | expand

Commit Message

Sergei Zhmylev Jan. 19, 2023, 12:10 p.m. UTC
From: Sergei Zhmylev <s.zhmylev@yadro.com>

TARGET_ARCH for most of x86_64 machines sets additional
-march parameter in meson configuration, which is not supported
during build and several meson recipes fail.  The patch makes
meson.bbclass use TRANSLATED_TARGET_ARCH instead of TARGET_ARCH
in order to properly set -march for cross builds.

Signed-off-by: Sergei Zhmylev <s.zhmylev@yadro.com>
---
 meta/classes-recipe/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Purdie Jan. 19, 2023, 1 p.m. UTC | #1
On Thu, 2023-01-19 at 15:10 +0300, Sergey Zhmylev wrote:
> From: Sergei Zhmylev <s.zhmylev@yadro.com>
> 
> TARGET_ARCH for most of x86_64 machines sets additional
> -march parameter in meson configuration, which is not supported
> during build and several meson recipes fail.  The patch makes
> meson.bbclass use TRANSLATED_TARGET_ARCH instead of TARGET_ARCH
> in order to properly set -march for cross builds.
> 
> Signed-off-by: Sergei Zhmylev <s.zhmylev@yadro.com>
> ---
>  meta/classes-recipe/meson.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-recipe/meson.bbclass
> index 48688bed75..65fd80fc7e 100644
> --- a/meta/classes-recipe/meson.bbclass
> +++ b/meta/classes-recipe/meson.bbclass
> @@ -97,7 +97,7 @@ endian = '${@meson_endian('HOST', d)}'
>  [target_machine]
>  system = '${@meson_operating_system('TARGET_OS', d)}'
>  cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}'
> -cpu = '${TARGET_ARCH}'
> +cpu = '${TRANSLATED_TARGET_ARCH}'
>  endian = '${@meson_endian('TARGET', d)}'
>  EOF

This doesn't sounds correct to me.

TRANSLATED_TARGET_ARCH is TARGET_ARCH with "_" mapped to "-", there
isn't any march change. As such, this commit message doesn't sound
right.

Can you give a bit more detail about the problem you're solving and how
this solves it please?

Thanks,

Richard
diff mbox series

Patch

diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-recipe/meson.bbclass
index 48688bed75..65fd80fc7e 100644
--- a/meta/classes-recipe/meson.bbclass
+++ b/meta/classes-recipe/meson.bbclass
@@ -97,7 +97,7 @@  endian = '${@meson_endian('HOST', d)}'
 [target_machine]
 system = '${@meson_operating_system('TARGET_OS', d)}'
 cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}'
-cpu = '${TARGET_ARCH}'
+cpu = '${TRANSLATED_TARGET_ARCH}'
 endian = '${@meson_endian('TARGET', d)}'
 EOF