[meta-zephyr] zephyr: use TCLIBC=newlib directly

Submitted by Ross Burton on Oct. 20, 2020, 12:42 p.m. | Patch ID: 177349

Details

Message ID 20201020124254.471303-1-ross.burton@arm.com
State Superseded
Headers show

Commit Message

Ross Burton Oct. 20, 2020, 12:42 p.m.
Instead of setting TCLIBC=baremetal and then adding newlib in various places,
just set TCLIBC=newlib directly.

This also means we can use the standard DEPENDS instead of reinventing them.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 conf/distro/zephyr.conf                               | 7 +------
 recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc | 3 ---
 2 files changed, 1 insertion(+), 9 deletions(-)

Patch hide | download patch | download mbox

diff --git a/conf/distro/zephyr.conf b/conf/distro/zephyr.conf
index 44448af..a98da32 100644
--- a/conf/distro/zephyr.conf
+++ b/conf/distro/zephyr.conf
@@ -5,16 +5,11 @@  DISTRO_VERSION = "1.0"
 
 TARGET_VENDOR = "-yocto"
 
-TCLIBC = "baremetal"
-TCLIBCAPPEND = ""
+TCLIBC = "newlib"
 
 TEST_TARGET = "QemuTargetZephyr"
 TEST_SUITES = "zephyr"
 
-PREFERRED_PROVIDER_virtual/libc = "newlib"
-PREFERRED_PROVIDER_virtual/libiconv = "newlib"
-
-TOOLCHAIN_TARGET_TASK += " newlib"
 INHERIT += "siteinfo-zephyr"
 
 INHERIT += "uninative"
diff --git a/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc b/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
index 7fa4b25..b947472 100644
--- a/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
+++ b/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
@@ -19,9 +19,6 @@  EXTRA_OECMAKE_append_arm = " -DZEPHYR_MODULES=${S}/modules/cmsis"
 export ZEPHYR_BASE="${S}"
 
 
-# We always need a toolchain to cross-compile.
-INHIBIT_DEFAULT_DEPS = "1"
-DEPENDS += "gcc-cross-${TARGET_ARCH} libgcc ${TOOLCHAIN_TARGET_TASK} gperf-native"
 DEPENDS += " python3-pyelftools-native python3-pyyaml-native python3-pykwalify-native"
 CROSS_COMPILE = "${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}"
 

Comments

Ross Burton Oct. 20, 2020, 12:44 p.m.
Please do review this one carefully, it continues to build for me and
solves a build failure when using meta-zephyr but not DISTRO=zephyr
(instead, a custom DISTRO and a MACHINE that sets TCLIBC=newlib) but
obviously it is rooting around the build depends and I didn't test the
SDK pieces.

Ross

On Tue, 20 Oct 2020 at 13:43, Ross Burton via lists.yoctoproject.org
<ross=burtonini.com@lists.yoctoproject.org> wrote:
>
> Instead of setting TCLIBC=baremetal and then adding newlib in various places,
> just set TCLIBC=newlib directly.
>
> This also means we can use the standard DEPENDS instead of reinventing them.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  conf/distro/zephyr.conf                               | 7 +------
>  recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc | 3 ---
>  2 files changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/conf/distro/zephyr.conf b/conf/distro/zephyr.conf
> index 44448af..a98da32 100644
> --- a/conf/distro/zephyr.conf
> +++ b/conf/distro/zephyr.conf
> @@ -5,16 +5,11 @@ DISTRO_VERSION = "1.0"
>
>  TARGET_VENDOR = "-yocto"
>
> -TCLIBC = "baremetal"
> -TCLIBCAPPEND = ""
> +TCLIBC = "newlib"
>
>  TEST_TARGET = "QemuTargetZephyr"
>  TEST_SUITES = "zephyr"
>
> -PREFERRED_PROVIDER_virtual/libc = "newlib"
> -PREFERRED_PROVIDER_virtual/libiconv = "newlib"
> -
> -TOOLCHAIN_TARGET_TASK += " newlib"
>  INHERIT += "siteinfo-zephyr"
>
>  INHERIT += "uninative"
> diff --git a/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc b/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
> index 7fa4b25..b947472 100644
> --- a/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
> +++ b/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
> @@ -19,9 +19,6 @@ EXTRA_OECMAKE_append_arm = " -DZEPHYR_MODULES=${S}/modules/cmsis"
>  export ZEPHYR_BASE="${S}"
>
>
> -# We always need a toolchain to cross-compile.
> -INHIBIT_DEFAULT_DEPS = "1"
> -DEPENDS += "gcc-cross-${TARGET_ARCH} libgcc ${TOOLCHAIN_TARGET_TASK} gperf-native"
>  DEPENDS += " python3-pyelftools-native python3-pyyaml-native python3-pykwalify-native"
>  CROSS_COMPILE = "${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}"
>
> --
> 2.25.1
>
>
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#51129): https://lists.yoctoproject.org/g/yocto/message/51129
Mute This Topic: https://lists.yoctoproject.org/mt/77680544/3617530
Group Owner: yocto+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Khem Raj Oct. 20, 2020, 5:06 p.m.
On 10/20/20 5:42 AM, Ross Burton wrote:
> Instead of setting TCLIBC=baremetal and then adding newlib in various places,
> just set TCLIBC=newlib directly.
> 
> This also means we can use the standard DEPENDS instead of reinventing them.
> 

I think this will also link the app with newlib now which previously was 
using baremetal.

> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>   conf/distro/zephyr.conf                               | 7 +------
>   recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc | 3 ---
>   2 files changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/conf/distro/zephyr.conf b/conf/distro/zephyr.conf
> index 44448af..a98da32 100644
> --- a/conf/distro/zephyr.conf
> +++ b/conf/distro/zephyr.conf
> @@ -5,16 +5,11 @@ DISTRO_VERSION = "1.0"
>   
>   TARGET_VENDOR = "-yocto"
>   
> -TCLIBC = "baremetal"
> -TCLIBCAPPEND = ""
> +TCLIBC = "newlib"
>   
>   TEST_TARGET = "QemuTargetZephyr"
>   TEST_SUITES = "zephyr"
>   
> -PREFERRED_PROVIDER_virtual/libc = "newlib"
> -PREFERRED_PROVIDER_virtual/libiconv = "newlib"
> -
> -TOOLCHAIN_TARGET_TASK += " newlib"
>   INHERIT += "siteinfo-zephyr"
>   
>   INHERIT += "uninative"
> diff --git a/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc b/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
> index 7fa4b25..b947472 100644
> --- a/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
> +++ b/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
> @@ -19,9 +19,6 @@ EXTRA_OECMAKE_append_arm = " -DZEPHYR_MODULES=${S}/modules/cmsis"
>   export ZEPHYR_BASE="${S}"
>   
>   
> -# We always need a toolchain to cross-compile.
> -INHIBIT_DEFAULT_DEPS = "1"
> -DEPENDS += "gcc-cross-${TARGET_ARCH} libgcc ${TOOLCHAIN_TARGET_TASK} gperf-native"
>   DEPENDS += " python3-pyelftools-native python3-pyyaml-native python3-pykwalify-native"
>   CROSS_COMPILE = "${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}"
>   
> 
> 
> 
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#51138): https://lists.yoctoproject.org/g/yocto/message/51138
Mute This Topic: https://lists.yoctoproject.org/mt/77680544/3617530
Group Owner: yocto+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Naveen Saini Oct. 21, 2020, 5:35 a.m.
Few kernel testcases have dependencies on gperf-native, so we should keep it in DEPENDS.

Regards,
Naveen

-----Original Message-----
From: Ross Burton <ross.burton@arm.com> 
Sent: Tuesday, October 20, 2020 8:43 PM
To: yocto@lists.yoctoproject.org
Cc: Saini, Naveen Kumar <naveen.kumar.saini@intel.com>
Subject: [meta-zephyr][PATCH] zephyr: use TCLIBC=newlib directly

Instead of setting TCLIBC=baremetal and then adding newlib in various places, just set TCLIBC=newlib directly.

This also means we can use the standard DEPENDS instead of reinventing them.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 conf/distro/zephyr.conf                               | 7 +------
 recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc | 3 ---
 2 files changed, 1 insertion(+), 9 deletions(-)

--
2.25.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#51144): https://lists.yoctoproject.org/g/yocto/message/51144
Mute This Topic: https://lists.yoctoproject.org/mt/77680544/3617530
Group Owner: yocto+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Ross Burton Oct. 21, 2020, 8:19 p.m.
This is a system generated Comment: Patch 177349 was automatically marked as superseded by patch 177378.