[3/3] insane: use HOST_ variables, not TARGET_ to determine the cross system

Message ID 20220224150302.1341776-4-alex@linutronix.de
State Accepted, archived
Commit cd25e5544ca3f48cc4c32001e917aa3dc20dd79a
Headers show
Series Fixes to enable cross-canadian toolchains | expand

Commit Message

Alexander Kanavin Feb. 24, 2022, 3:03 p.m. UTC
Almost everywhere those are the same, except when making a cross toolchain
where HOST_ is where it's going to run, and TARGET_ is what it's going to
produce.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/classes/insane.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Ross Burton Feb. 25, 2022, 2:30 p.m. UTC | #1
On Thu, 24 Feb 2022 at 15:03, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
> Almost everywhere those are the same, except when making a cross toolchain
> where HOST_ is where it's going to run, and TARGET_ is what it's going to
> produce.
>
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
>  meta/classes/insane.bbclass | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> index 4fc3c06c64..890e865a8f 100644
> --- a/meta/classes/insane.bbclass
> +++ b/meta/classes/insane.bbclass
> @@ -325,8 +325,8 @@ def package_qa_check_arch(path,name,d, elf, messages):
>      if not elf:
>          return
>
> -    target_os   = d.getVar('TARGET_OS')
> -    target_arch = d.getVar('TARGET_ARCH')
> +    target_os   = d.getVar('HOST_OS')
> +    target_arch = d.getVar('HOST_ARCH')
>      provides = d.getVar('PROVIDES')
>      bpn = d.getVar('BPN')

Interestingly I was just looking at this code.  Does this change mean
we can remove the skipping of nativesdk recipes in the arch check?

Ross
Alexander Kanavin Feb. 25, 2022, 2:33 p.m. UTC | #2
On Fri, 25 Feb 2022 at 15:30, Ross Burton <ross@burtonini.com> wrote:
> > -    target_os   = d.getVar('TARGET_OS')
> > -    target_arch = d.getVar('TARGET_ARCH')
> > +    target_os   = d.getVar('HOST_OS')
> > +    target_arch = d.getVar('HOST_ARCH')
> >      provides = d.getVar('PROVIDES')
> >      bpn = d.getVar('BPN')
>
> Interestingly I was just looking at this code.  Does this change mean
> we can remove the skipping of nativesdk recipes in the arch check?

I don't know, the only answer I have is 'patches welcome' :)

Alex

Patch

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 4fc3c06c64..890e865a8f 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -325,8 +325,8 @@  def package_qa_check_arch(path,name,d, elf, messages):
     if not elf:
         return
 
-    target_os   = d.getVar('TARGET_OS')
-    target_arch = d.getVar('TARGET_ARCH')
+    target_os   = d.getVar('HOST_OS')
+    target_arch = d.getVar('HOST_ARCH')
     provides = d.getVar('PROVIDES')
     bpn = d.getVar('BPN')
 
@@ -691,8 +691,8 @@  def prepopulate_objdump_p(elf, d):
 # Walk over all files in a directory and call func
 def package_qa_walk(warnfuncs, errorfuncs, package, d):
     #if this will throw an exception, then fix the dict above
-    target_os   = d.getVar('TARGET_OS')
-    target_arch = d.getVar('TARGET_ARCH')
+    target_os   = d.getVar('HOST_OS')
+    target_arch = d.getVar('HOST_ARCH')
 
     warnings = {}
     errors = {}