diff mbox series

classes: make TOOLCHAIN more permissive for kernel

Message ID 20221130162113.3731385-1-pyih.soft@gmail.com
State Accepted, archived
Commit be1634fc35dcc81f0301d942064a6eed584e0704
Headers show
Series classes: make TOOLCHAIN more permissive for kernel | expand

Commit Message

Alexey Smirnov Nov. 30, 2022, 4:21 p.m. UTC
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(-)

Comments

Ross Burton Dec. 1, 2022, 11:25 a.m. UTC | #1
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
Alexandre Belloni Dec. 1, 2022, 12:14 p.m. UTC | #2
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
Ross Burton Dec. 1, 2022, 1:27 p.m. UTC | #3
> 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
Alexandre Belloni Dec. 1, 2022, 3:14 p.m. UTC | #4
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]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

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"