Skip to contentSkip to conversation

kernel-arch.bbclass: Add xtensa and arc into valid_archs table

PATCH In review Juro Bystricky 2 participants 5 messages Oct 11, 2016 – Oct 19, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-arch.bbclass: Add xtensa and arc into valid_archs table

Both "arc" and "xtensa" are valid Linux architectures, add them into valid_archs table.

---
 meta/classes/kernel-arch.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel-arch.bbclass +1 -1
index 8a4bef1..ea976c6 100644
@@ -14,7 +14,7 @@ valid_archs = "alpha cris ia64 \
                parisc s390  v850 \
                avr32 blackfin \
                microblaze \
-               nios2"
+               nios2 arc xtensa"
 
 def map_kernel_arch(a, d):
     import re
Signature · 1 line
2.7.4
#1 lore raw
Quoted 16 lines · Juro Bystricky

Both "arc" and "xtensa" are valid Linux architectures, add them into valid_archs table.

---
meta/classes/kernel-arch.bbclass | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel-arch.bbclass +0 -0
index 8a4bef1..ea976c6 100644

meta/classes/kernel-arch.bbclass valid_archs = "alpha cris ia64 \ · line 17

Quoted 5 lines
meta/classes/kernel-arch.bbclass +1 -1
@@ -14,7 +14,7 @@ valid_archs = "alpha cris ia64 \
               parisc s390  v850 \
               avr32 blackfin \
               microblaze \
-               nios2"
+               nios2 arc xtensa”

there parisc etc as well so in essence patch is ok but I wonder if we should remove the arches we dont actively support in OE or extended OE ecosystem.

Quoted 11 lines

def map_kernel_arch(a, d):
import re
--
2.7.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw

The single purpose of "map_kernel_arch" is to set

export ARCH = "arch_xxx"

Presently, we must set ARCH even when building baremetal toolchains only, without any need to build kernel. However, in this case we may encounter a bogus error such as "cannot map arch_xxx to a linux kernel architecture". The simplest way to avoid this is to place arch_xxx into the table "valid_archs". (That was the main reason for the patch).

A better but more complex way would be to modify the code so map_kernel_arch is not called at all when NOT building kernel or kernel modules. This would also allow building baremetal cross-toolchains for arches that don't have Linux kernels at all.

Another way to consider is perhaps just getting rid of the table "valid_archs" entirely.

"map_kernel_arch" maps arch_aaa -> arch_xxx for some cases. If there is no explicit mapping, then it could simply map

arch_aaa->arch_aaa

resulting in export ARCH="arch_aaa"
There would be no error generated. If ARCH is not a valid
arch for a Linux kernel, we would encounter a build error at some point. But that, I believe is the same case now if we try to build a kernel with a valid kernel ARCH but not supported actively in OE or extended OE ecosystem.

Quoted 47 lines

-----Original Message-----
From: Khem Raj [mailto:[email protected]]
Sent: Monday, October 17, 2016 4:40 PM
To: Bystricky, Juro <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [OE-core] [PATCH] kernel-arch.bbclass: Add xtensa and arc into valid_archs table

Quoted 1 line

On Oct 11, 2016, at 9:31 AM, Juro Bystricky <[email protected]>

meta/classes/kernel-

Quoted 10 lines · wrote:

Both "arc" and "xtensa" are valid Linux architectures, add them into valid_archs table.

---
meta/classes/kernel-arch.bbclass | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel- renamed from meta/classes/kernel-arch.bbclass +0 -0

arch.bbclass

meta/classes/kernel-arch.bbclass valid_archs = "alpha cris ia64 \ · line 17

Quoted 9 lines

index 8a4bef1..ea976c6 100644

meta/classes/kernel-arch.bbclass +1 -1
@@ -14,7 +14,7 @@ valid_archs = "alpha cris ia64 \
               parisc s390  v850 \
               avr32 blackfin \
               microblaze \
-               nios2"
+               nios2 arc xtensa”

there parisc etc as well so in essence patch is ok but I wonder if we should
remove the arches we dont actively support in OE or extended OE ecosystem.

Quoted 11 lines

def map_kernel_arch(a, d):
import re
--
2.7.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 24 lines · Juro

The single purpose of "map_kernel_arch" is to set

export ARCH = "arch_xxx"

Presently, we must set ARCH even when building baremetal toolchains only, without any need to build kernel. However, in this case we may encounter a bogus error such as "cannot map arch_xxx to a linux kernel architecture". The simplest way to avoid this is to place arch_xxx into the table "valid_archs". (That was the main reason for the patch).

A better but more complex way would be to modify the code so map_kernel_arch is not called at all when NOT building kernel or kernel modules. This would also allow building baremetal cross-toolchains for arches that don't have Linux kernels at all.

Another way to consider is perhaps just getting rid of the table "valid_archs" entirely.

"map_kernel_arch" maps arch_aaa -> arch_xxx for some cases. If there is no explicit mapping, then it could simply map

Quoted 7 lines

arch_aaa->arch_aaa

resulting in export ARCH="arch_aaa"
There would be no error generated. If ARCH is not a valid
arch for a Linux kernel, we would encounter a build error at some point. But that, I believe is the same case now if we try to build a kernel with a valid kernel ARCH but not supported actively in OE or extended OE ecosystem.

I think you should add a check for testing TARGET_OS and if its not linux then ignore the valid kernel arches check.

Quoted 52 lines
Quoted 51 lines

-----Original Message-----
From: Khem Raj [mailto:[email protected]]
Sent: Monday, October 17, 2016 4:40 PM
To: Bystricky, Juro <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [OE-core] [PATCH] kernel-arch.bbclass: Add xtensa and arc into valid_archs table

Quoted 1 line

On Oct 11, 2016, at 9:31 AM, Juro Bystricky <[email protected]>

meta/classes/kernel-

Quoted 10 lines · wrote:

Both "arc" and "xtensa" are valid Linux architectures, add them into valid_archs table.

---
meta/classes/kernel-arch.bbclass | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel- renamed from meta/classes/kernel-arch.bbclass +0 -0

arch.bbclass

meta/classes/kernel-arch.bbclass valid_archs = "alpha cris ia64 \ · line 17

Quoted 9 lines

index 8a4bef1..ea976c6 100644

meta/classes/kernel-arch.bbclass +1 -1
@@ -14,7 +14,7 @@ valid_archs = "alpha cris ia64 \
              parisc s390  v850 \
              avr32 blackfin \
              microblaze \
-               nios2"
+               nios2 arc xtensa”

there parisc etc as well so in essence patch is ok but I wonder if we should
remove the arches we dont actively support in OE or extended OE ecosystem.

Quoted 11 lines

def map_kernel_arch(a, d):
import re
--
2.7.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#4 lore raw

Thanks. I will add the test for TARGET_OS in a separate patch.

Quoted 102 lines

-----Original Message-----
From: Khem Raj [mailto:[email protected]]
Sent: Tuesday, October 18, 2016 10:53 AM
To: Bystricky, Juro <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [OE-core] [PATCH] kernel-arch.bbclass: Add xtensa and arc into valid_archs table

Quoted 1 line

On Oct 18, 2016, at 9:13 AM, Bystricky, Juro <[email protected]>

Quoted 8 lines · wrote:

The single purpose of "map_kernel_arch" is to set

export ARCH = "arch_xxx"

Presently, we must set ARCH even when building baremetal toolchains only, without any need to build kernel. However, in this case we may encounter a bogus error such as "cannot map arch_xxx to a linux kernel

architecture".

Quoted 6 lines

The simplest way to avoid this is to place arch_xxx into the table "valid_archs". (That was the main reason for the patch).

A better but more complex way would be to modify the code so map_kernel_arch is not called at all when NOT building kernel or kernel modules. This would also allow building baremetal cross-toolchains for

arches

Quoted 8 lines

that don't have Linux kernels at all.

Another way to consider is perhaps just getting rid of the table "valid_archs" entirely.

"map_kernel_arch" maps arch_aaa -> arch_xxx for some cases. If there is no explicit mapping, then it could simply map

Quoted 7 lines

arch_aaa->arch_aaa

resulting in export ARCH="arch_aaa"
There would be no error generated. If ARCH is not a valid arch for a Linux kernel, we would encounter a build error at some point. But that, I believe is the same case now if we try to build a kernel with a valid kernel ARCH but not supported actively in OE or extended OE

ecosystem.

I think you should add a check for testing TARGET_OS and if its not linux then
ignore the valid kernel arches check.

Quoted 10 lines
Quoted 10 lines

-----Original Message-----
From: Khem Raj [mailto:[email protected]]
Sent: Monday, October 17, 2016 4:40 PM
To: Bystricky, Juro <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [OE-core] [PATCH] kernel-arch.bbclass: Add xtensa and arc

into

Quoted 16 lines
Quoted 16 lines

valid_archs table

Quoted 1 line

On Oct 11, 2016, at 9:31 AM, Juro Bystricky <[email protected]>

meta/classes/kernel-

Quoted 10 lines · wrote:

Both "arc" and "xtensa" are valid Linux architectures, add them into valid_archs table.

---
meta/classes/kernel-arch.bbclass | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel- renamed from meta/classes/kernel-arch.bbclass +0 -0

arch.bbclass

Quoted 13 lines
Quoted 5 lines
Quoted 5 lines

index 8a4bef1..ea976c6 100644

meta/classes/kernel-arch.bbclass +0 -0
@@ -14,7 +14,7 @@ valid_archs = "alpha cris ia64 \
              parisc s390  v850 \
Quoted 8 lines

meta/classes/kernel-arch.bbclass valid_archs = "alpha cris ia64 \

Quoted 4 lines
meta/classes/kernel-arch.bbclass +1 -1
              avr32 blackfin \
              microblaze \
-               nios2"
+               nios2 arc xtensa”

there parisc etc as well so in essence patch is ok but I wonder if we should
remove the arches we dont actively support in OE or extended OE

ecosystem.

Quoted 13 lines
Quoted 12 lines
Quoted 12 lines

def map_kernel_arch(a, d):
import re
--
2.7.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core