Skip to contentSkip to conversation

zephyr: use TCLIBC=newlib directly

PATCH Superseded Ross Burton 3 participants 4 messages Oct 20, 2020 – Oct 21, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 conf/distro/zephyr.conf                               | 7 +------
 recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc | 3 ---
 2 files changed, 1 insertion(+), 9 deletions(-)
conf/distro/zephyr.conf +1 -6
index 44448af..a98da32 100644
@@ -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"
recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc +0 -3
index 7fa4b25..b947472 100644
@@ -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}"
 
Signature · 1 line
2.25.1
#1 lore raw

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

Quoted 54 lines · Ross Burton via lists.yoctoproject.org

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.

---
 conf/distro/zephyr.conf                               | 7 +------
 recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc | 3 ---
 2 files changed, 1 insertion(+), 9 deletions(-)
conf/distro/zephyr.conf +1 -6
index 44448af..a98da32 100644
@@ -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"
recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc +0 -4
index 7fa4b25..b947472 100644
@@ -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

#2 lore raw
In reply to Ross Burton
Quoted 5 lines · Ross Burton

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.

Quoted 47 lines
---
  conf/distro/zephyr.conf                               | 7 +------
  recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc | 3 ---
  2 files changed, 1 insertion(+), 9 deletions(-)
conf/distro/zephyr.conf +1 -6
index 44448af..a98da32 100644
@@ -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"
recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc +0 -3
index 7fa4b25..b947472 100644
@@ -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}"
 
#3 lore raw
In reply to Ross Burton

Few kernel testcases have dependencies on gperf-native, so we should keep it in DEPENDS.

Regards,
Naveen

-----Original Message-----
From: Ross Burton <[email protected]>
Sent: Tuesday, October 20, 2020 8:43 PM
To: [email protected]
Cc: Saini, Naveen Kumar <[email protected]>
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.

---
 conf/distro/zephyr.conf                               | 7 +------
 recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc | 3 ---
 2 files changed, 1 insertion(+), 9 deletions(-)
conf/distro/zephyr.conf +1 -6
@@ -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"
recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc +0 -3
index 7fa4b25..b947472 100644
@@ -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