Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] classes: make TOOLCHAIN more permissive for kernel
@ 2022-11-30 16:21 Alexey Smirnov
  2022-12-01 11:25 ` [OE-core] " Ross Burton
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Smirnov @ 2022-11-30 16:21 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexey Smirnov

Currently TOOLCHAIN is strictly set to gcc in kernel-arch.bbclass.
And this prevents any TOOLCHAIN changes for any kernel recipe.
This change makes TOOLCHAIN configurable as usual.

Signed-off-by: Alexey Smirnov <pyih.soft@gmail.com>
---
 meta/classes-recipe/kernel-arch.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass
index 6f5d3bde6c..1531ae6cd5 100644
--- a/meta/classes-recipe/kernel-arch.bbclass
+++ b/meta/classes-recipe/kernel-arch.bbclass
@@ -70,5 +70,5 @@ HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}"
 KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} -fdebug-prefix-map=${STAGING_KERNEL_BUILDDIR}=${KERNEL_SRC_PATH}"
 KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
 KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}"
-TOOLCHAIN = "gcc"
+TOOLCHAIN ?= "gcc"
 
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] classes: make TOOLCHAIN more permissive for kernel
  2022-11-30 16:21 [PATCH] classes: make TOOLCHAIN more permissive for kernel Alexey Smirnov
@ 2022-12-01 11:25 ` Ross Burton
  2022-12-01 12:14   ` Alexandre Belloni
  0 siblings, 1 reply; 5+ messages in thread
From: Ross Burton @ 2022-12-01 11:25 UTC (permalink / raw)
  To: pyih.soft@gmail.com; +Cc: openembedded-core@lists.openembedded.org

On 30 Nov 2022, at 16:21, Alexey Smirnov via lists.openembedded.org <pyih.soft=gmail.com@lists.openembedded.org> wrote:
> -TOOLCHAIN = "gcc"
> +TOOLCHAIN ?= “gcc"

If the kernel is buildable with clang then the TOOLCHAIN statement should just be removed.

Ross

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] classes: make TOOLCHAIN more permissive for kernel
  2022-12-01 11:25 ` [OE-core] " Ross Burton
@ 2022-12-01 12:14   ` Alexandre Belloni
  2022-12-01 13:27     ` Ross Burton
  0 siblings, 1 reply; 5+ messages in thread
From: Alexandre Belloni @ 2022-12-01 12:14 UTC (permalink / raw)
  To: Ross Burton; +Cc: pyih.soft@gmail.com, openembedded-core@lists.openembedded.org

On 01/12/2022 11:25:29+0000, Ross Burton wrote:
> On 30 Nov 2022, at 16:21, Alexey Smirnov via lists.openembedded.org <pyih.soft=gmail.com@lists.openembedded.org> wrote:
> > -TOOLCHAIN = "gcc"
> > +TOOLCHAIN ?= “gcc"
> 
> If the kernel is buildable with clang then the TOOLCHAIN statement should just be removed.
> 

It is buildable but the generated binary is not necessarily bootable,
depending on the architecture



-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] classes: make TOOLCHAIN more permissive for kernel
  2022-12-01 12:14   ` Alexandre Belloni
@ 2022-12-01 13:27     ` Ross Burton
  2022-12-01 15:14       ` Alexandre Belloni
  0 siblings, 1 reply; 5+ messages in thread
From: Ross Burton @ 2022-12-01 13:27 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: pyih.soft@gmail.com, openembedded-core@lists.openembedded.org



> On 1 Dec 2022, at 12:14, Alexandre Belloni <alexandre.belloni@bootlin.com> wrote:
> 
> On 01/12/2022 11:25:29+0000, Ross Burton wrote:
>> On 30 Nov 2022, at 16:21, Alexey Smirnov via lists.openembedded.org <pyih.soft=gmail.com@lists.openembedded.org> wrote:
>>> -TOOLCHAIN = "gcc"
>>> +TOOLCHAIN ?= “gcc"
>> 
>> If the kernel is buildable with clang then the TOOLCHAIN statement should just be removed.
>> 
> 
> It is buildable but the generated binary is not necessarily bootable,
> depending on the architecture

So maybe the kernel class should just set TOOLCHAIN for those architectures where it is known to not work, leaving it unset (and thus overridable with a global assignment) for everything else?

Ross

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] classes: make TOOLCHAIN more permissive for kernel
  2022-12-01 13:27     ` Ross Burton
@ 2022-12-01 15:14       ` Alexandre Belloni
  0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2022-12-01 15:14 UTC (permalink / raw)
  To: Ross Burton; +Cc: pyih.soft@gmail.com, openembedded-core@lists.openembedded.org

On 01/12/2022 13:27:13+0000, Ross Burton wrote:
> 
> 
> > On 1 Dec 2022, at 12:14, Alexandre Belloni <alexandre.belloni@bootlin.com> wrote:
> > 
> > On 01/12/2022 11:25:29+0000, Ross Burton wrote:
> >> On 30 Nov 2022, at 16:21, Alexey Smirnov via lists.openembedded.org <pyih.soft=gmail.com@lists.openembedded.org> wrote:
> >>> -TOOLCHAIN = "gcc"
> >>> +TOOLCHAIN ?= “gcc"
> >> 
> >> If the kernel is buildable with clang then the TOOLCHAIN statement should just be removed.
> >> 
> > 
> > It is buildable but the generated binary is not necessarily bootable,
> > depending on the architecture
> 
> So maybe the kernel class should just set TOOLCHAIN for those architectures where it is known to not work, leaving it unset (and thus overridable with a global assignment) for everything else?
> 

I'm not sure this is doable because oe-core doesn't have support for all
the architectures that are supported by the kernel and so it would be
better to list the ones that are actually supporting clang. Even then we
will probably end up with people wanting to build with clang just to
ensure there are no new warnings even if the kernel they are going to
use is built with gcc (I've already been asked).

> Ross

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#174059): https://lists.openembedded.org/g/openembedded-core/message/174059
> Mute This Topic: https://lists.openembedded.org/mt/95361461/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-01 15:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-30 16:21 [PATCH] classes: make TOOLCHAIN more permissive for kernel Alexey Smirnov
2022-12-01 11:25 ` [OE-core] " Ross Burton
2022-12-01 12:14   ` Alexandre Belloni
2022-12-01 13:27     ` Ross Burton
2022-12-01 15:14       ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox