libgloss: update bbappend to match 4.5.0
PATCH 1/4 libgloss: update bbappend to match 4.5.0
From: Lee Chee Yang <[email protected]>
the patch no longer applies, remove it and append the build flags to CFLAGS
--- ...loss-i386-Disable-warnings-as-errors.patch | 41 ------------------- .../recipes-core/newlib/libgloss_git.bbappend | 4 +- 2 files changed, 2 insertions(+), 43 deletions(-) delete mode 100644 meta-zephyr-core/recipes-core/newlib/files/0001-libgloss-i386-Disable-warnings-as-errors.patch
meta-zephyr-core/recipes-core/newlib/files/0001-libgloss-i386-Disable-warnings-as-errors.patch deleted +0 -41
@@ -1,41 +0,0 @@ -From 5dd8c118c904f5dd956ac754a10faddd35d22df2 Mon Sep 17 00:00:00 2001 -From: Naveen Saini <[email protected]> -Date: Thu, 26 Sep 2024 16:43:43 +0800 -Subject: [PATCH] libgloss/i386: Disable warnings as errors - -i586-yocto-elf/libgloss/4.4.0+git/git/libgloss/i386/cygmon-gmon.c:109:21: warning: implicit declaration of function 'sbrk' [-Wimplicit-function-declaration] - 109 | buffer = (char *) sbrk (monsize); - | ^~~~ -i586-yocto-elf/libgloss/4.4.0+git/git/libgloss/i386/cygmon-gmon.c:112:7: warning: implicit declaration of function 'write'; did you mean 'fwrite'? [-Wimplicit-function-declaration] - 112 | write (2, MSG , sizeof(MSG)); - | ^~~~~ - | fwrite -i586-yocto-elf/libgloss/4.4.0+git/git/libgloss/i386/cygmon-gmon.c:113:7: warning: 'return' with no value, in function returning non-void [-Wreturn-mismatch] - 113 | return; - | ^~~~~~ -i586-yocto-elf/libgloss/4.4.0+git/git/libgloss/i386/cygmon-gmon.c:198:1: warning: return type defaults to 'int' [-Wimplicit-int] - 198 | _mcount() - -Upstream-Status: Inappropriate [OE-Specific] - -Signed-off-by: Naveen Saini <[email protected]> ---- - libgloss/i386/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libgloss/i386/Makefile.in b/libgloss/i386/Makefile.in -index 7ed0b075f..729f33d90 100644 ---- a/libgloss/i386/Makefile.in -+++ b/libgloss/i386/Makefile.in -@@ -69,7 +69,7 @@ OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ - CRT0 = cygmon-crt0.o - CYGMON_OBJS = cygmon-salib.o cygmon-gmon.o - --CFLAGS = -g -+CFLAGS = @CFLAGS@ -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=return-mismatch - - GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \ - then echo -L${objroot}/../gcc ; fi` --- -2.37.3 -
meta-zephyr-core/recipes-core/newlib/libgloss_git.bbappend +2 -2
@@ -1,2 +1,2 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/files:" -SRC_URI:append:qemu-x86 = " file://0001-libgloss-i386-Disable-warnings-as-errors.patch" +CFLAGS:append:qemu-x86 = " -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=return-mismatch " +
Signature · 1 line
2.43.0
PATCH 2/4 zephyr-kernel-4.2.0: fix unable to find gen_kobject_list.py
From: Lee Chee Yang <[email protected]>
Fix error when build using Yocto toolchain.
| Run Build Command(s): ninja -v -j 22 all
| ninja: error: 'zephyr/GEN_KOBJECT_LIST-NOTFOUND', needed by 'zephyr/include/generated/zephyr/driver-validation.h', missing and no known rule to make it
--- ...-fix-unable-find-gen_kobject_list.py.patch | 30 +++++++++++++++++++ .../zephyr-kernel/zephyr-kernel-src-4.2.0.inc | 1 + 2 files changed, 31 insertions(+) create mode 100644 meta-zephyr-core/recipes-kernel/zephyr-kernel/files/0001-fix-unable-find-gen_kobject_list.py.patch
meta-zephyr-core/recipes-kernel/zephyr-kernel/files/0001-fix-unable-find-gen_kobject_list.py.patch new file +30 -0
@@ -0,0 +1,30 @@ +From 0a9f8fedd237c4783ca3bf5c5721a1c940988984 Mon Sep 17 00:00:00 2001 +From: Lee Chee Yang <[email protected]> +Date: Wed, 17 Dec 2025 12:27:39 +0800 +Subject: [PATCH] fix unable find gen_kobject_list.py + +| Run Build Command(s): ninja -v -j 22 all +| ninja: error: 'zephyr/GEN_KOBJECT_LIST-NOTFOUND', needed by 'zephyr/include/generated/zephyr/driver-validation.h', missing and no known rule to make it + +Upstream-Status: Inappropriate [Cross-compilation specific] + +Signed-off-by: Lee Chee Yang <[email protected]> +--- + cmake/kobj.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/kobj.cmake b/cmake/kobj.cmake +index 6ccb85245fc..fa757509cfa 100644 +--- a/cmake/kobj.cmake ++++ b/cmake/kobj.cmake +@@ -1,6 +1,6 @@ + # SPDX-License-Identifier: Apache-2.0 + +-find_program(GEN_KOBJECT_LIST NAMES gen_kobject_list gen_kobject_list.py PATHS ${ZEPHYR_BASE}/scripts/build) ++find_program(GEN_KOBJECT_LIST NAMES gen_kobject_list gen_kobject_list.py PATHS ${ZEPHYR_BASE}/scripts/build NO_CMAKE_FIND_ROOT_PATH) + message(STATUS "Found gen_kobject_list: ${GEN_KOBJECT_LIST}") + if(GEN_KOBJECT_LIST MATCHES "\.py$") + set(GEN_KOBJECT_LIST_INTERPRETER ${PYTHON_EXECUTABLE}) +-- +2.43.0 +
meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src-4.2.0.inc +1 -0
@@ -146,6 +146,7 @@ SRC_URI_ZEPHYR_ZCBOR ?= "git://github.com/zephyrproject-rtos/zcbor;protocol=http SRC_URI_PATCHES ?= "\ file://0001-v4.2.0-x86-fix-efi-binary-generation-issue-in-cross-compila.patch;patchdir=zephyr \ + file://0001-fix-unable-find-gen_kobject_list.py.patch;patchdir=zephyr \ " SRC_URI = "\
Signature · 1 line
2.43.0
PATCH 3/4 zephyr-master.conf.json: add config for bitbake-setup
In reply to [email protected]From: Lee Chee Yang <[email protected]>
--- zephyr-master.conf.json | 82 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 zephyr-master.conf.json
zephyr-master.conf.json new file +82 -0
@@ -0,0 +1,82 @@ +{ + "description": "Meta-zephyr default configuration", + "sources": { + "bitbake": { + "git-remote": { + "remotes": { + "origin": { + "uri": "https://git.openembedded.org/bitbake" + } + }, + "branch": "master", + "rev": "master" + } + }, + "openembedded-core": { + "git-remote": { + "remotes": { + "origin": { + "uri": "https://git.openembedded.org/openembedded-core" + } + }, + "branch": "master", + "rev": "master" + } + }, + "meta-openembedded": { + "git-remote": { + "remotes": { + "origin": { + "uri": "https://git.openembedded.org/meta-openembedded" + } + }, + "branch": "master", + "rev": "master" + } + }, + "meta-zephyr": { + "git-remote": { + "remotes": { + "origin": { + "uri": "https://git.yoctoproject.org/meta-zephyr" + } + }, + "branch": "master", + "rev": "master" + } + } + }, + "bitbake-setup": { + "configurations": [ + { + "name": "zephyr-default", + "description": "Base zephyr configuration", + "setup-dir-name": "zephyr-master", + "bb-layers": [ + "openembedded-core/meta", + "meta-openembedded/meta-oe", + "meta-openembedded/meta-python" , + "meta-zephyr/meta-zephyr-core", + "meta-zephyr/meta-zephyr-bsp" + ], + "oe-fragments-one-of": { + "machine": { + "description": "Target machines", + "options" : [ + "machine/96b-nitrogen", + "machine/intel-x86-64", + "machine/qemu-cortex-m3", + "machine/qemu-x86" + ] + }, + "distro": { + "description": "Distribution configuration variants", + "options" : ["distro/zephyr"] + } + } + + } + ] + }, + "version": "1.0" +}
Signature · 1 line
2.43.0
PATCH 4/4 README: update build guide with bitbake-setup
In reply to [email protected]From: cheeyanglee <[email protected]>
update build guide to use bitbake-setup.
also drop the reference to poky
--- README.md | 121 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 43 deletions(-)
README.md +78 -43
@@ -6,76 +6,111 @@ This layer enables building Zephyr using Yocto Project. This layer depends on: - URI: https://git.yoctoproject.org/poky - layers: meta - branch: master + URI: https://git.openembedded.org/bitbake + branch: master - URI: https://git.openembedded.org/meta-openembedded - layers: meta-oe, meta-python - branch: master + URI: https://git.openembedded.org/openembedded-core + layers: meta + branch: master + + URI: https://git.openembedded.org/meta-openembedded + layers: meta-oe, meta-python + branch: master ## Building Zephyr Images via bitbake recipes -More detailed and up-to-date information can be found here: +### Quick Build -https://wiki.yoctoproject.org/wiki/TipsAndTricks/BuildingZephyrImages +Ensure your build host meets the +[Yocto Project system requirements](https://docs.yoctoproject.org/ref-manual/system-requirements.html) +and follow the +[Quick Build setup guide](https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html#yocto-project-quick-build) +to setup the host enviroment. -> **Pre-requisites:** -1. Refer [Yocto Project Quick Build]( https://docs.yoctoproject.org/dev/singleindex.html#yocto-project-quick-build) documentation. +Clone the following repos: -2. Clone and add following layers to BBLAYERS - * meta-openembedded/meta-oe - * meta-openembedded/meta-python - * meta-zephyr-core - * meta-zephyr-bsp -``` - $ mkdir sources - $ git clone -b <release-branch> https://git.yoctoproject.org/poky - $ git clone -b <branch-name> https://git.openembedded.org/meta-openembedded - $ git clone -b <branch-name> https://git.yoctoproject.org/meta-zephyr - $ source poky/oe-init-build-env - $ bitbake-layers add-layer ../meta-openembedded/meta-oe - $ bitbake-layers add-layer ../meta-openembedded/meta-python - $ bitbake-layers add-layer ../meta-zephyr/meta-zephyr-core - $ bitbake-layers add-layer ../meta-zephyr/meta-zephyr-bsp -``` +- bitbake +- meta-zephyr -### Building and Running Zephyr Samples +```console +git clone https://git.openembedded.org/bitbake +git clone https://git.yoctoproject.org/meta-zephyr +``` -You can build Zephyr samples. There are several sample recipes. +Initialize default build configuration with bitbake-setup: -To use the Yocto toolchain, modify local conf by adding: -``` - DISTRO = "zephyr" +```console +./bitbake/bin/bitbake-setup init --non-interactive \ + ./meta-zephyr/zephyr-master.conf.json \ + zephyr-default distro/zephy machine/qemu-x86 ``` -To use the Zephyr pre-built toolchain, modify local conf by adding: +Alternatively, run bitbake-setup with interactive mode to choose for +different configuration: + +```console +./bitbake/bin/bitbake-setup init ./meta-zephyr/zephyr-master.conf.json ``` - ZEPHYR_TOOLCHAIN_VARIANT = "zephyr" + +Initialize build environment + +```console +source ./bitbake-builds/zephyr-master/build/init-build-env ``` -For example, to build the Zephyr "philosophers" sample: +build the Zephyr "helloworld" sample: + +```console +bitbake zephyr-helloworld ``` - $ MACHINE=qemu-x86 bitbake zephyr-philosophers + +### Building and Running other Zephyr Samples + +You can build other Zephyr samples. There are several sample recipes +[available here](https://git.yoctoproject.org/meta-zephyr/tree/meta-zephyr-core/recipes-kernel/zephyr-kernel). + +For example, to build the +[Zephyr "philosophers" sample](https://git.yoctoproject.org/meta-zephyr/tree/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-philosophers.bb): + +```console +bitbake zephyr-philosophers ``` You can then run the created "philosophers" image in qemu: + +```console +runqemu ``` - $ runqemu qemu-x86 -``` -The same sample, for ARM image: +The same sample can be built for other machines/boards, for example ARM Cortex-M3: + +```console +bitbake-config-build enable-fragment machine/qemu-cortex-m3 +bitbake zephyr-philosophers +runqemu ``` - $ MACHINE=qemu-cortex-m3 bitbake zephyr-philosophers - $ runqemu qemu-cortex-m3 + +Alternatively, you can use the MACHINE variable to define the target machine, +you will need to disable the machine fragment to prevent conflict: + +```console +bitbake-config-build disable-fragment machine/qemu-x86 +MACHINE=qemu-cortex-m3 bitbake zephyr-philosophers +runqemu qemu-cortex-m3 ``` -The same sample, for Nios2 image: +The default configuration (with `zephyr` DISTRO) uses the Yocto Project toolchain +to compile Zephyr applications. To use the Zephyr pre-built toolchain instead, +modify `local.conf` by adding: + ``` - $ MACHINE=qemu-nios2 bitbake zephyr-philosophers - $ runqemu qemu-nios2 +ZEPHYR_TOOLCHAIN_VARIANT = "zephyr" ``` +Other Tips and Tricks for building zephyr image can be found +[here](https://wiki.yoctoproject.org/wiki/TipsAndTricks/BuildingZephyrImages). + + ### Flashing You can flash Zephyr samples to boards. Currently, the following MACHINEs
Signature · 1 line
2.43.0