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 |
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
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
> 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
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 --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"
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(-)