From d1627ac39b62765c7d8b0684005b6aa4e3e1817f Mon Sep 17 00:00:00 2001 From: Juro Bystricky Date: Wed, 28 Dec 2016 11:56:45 -0800 Subject: [PATCH] zephyr-kernel.inc: use own Makefile Zephyr RTOS uses the environmental variable ZEPHYR_GCC_VARIANT to determine which Makefile to use to build images. This allows different Makefiles for different toolchains, so the toolchains can co-exist. Rather than patching the included Makefile.toolchain.zephyr, we use our own file Makefile.toolchain.yocto. This Makefile will be used as long as Zephyr recipes set: export ZEPHYR_GCC_VARIANT="yocto" (Also removed some BOARD definitions) Signed-off-by: Juro Bystricky --- ...in.yocto-Don-t-error-out-if-CROSS_CO.patch | 26 ------------------- .../files/Makefile.toolchain.yocto | 8 ++++++ .../zephyr-kernel/zephyr-kernel.inc | 7 ++--- 3 files changed, 12 insertions(+), 29 deletions(-) delete mode 100644 recipes-kernel/zephyr-kernel/files/0001-Makefile.toolchain.yocto-Don-t-error-out-if-CROSS_CO.patch create mode 100644 recipes-kernel/zephyr-kernel/files/Makefile.toolchain.yocto diff --git a/recipes-kernel/zephyr-kernel/files/0001-Makefile.toolchain.yocto-Don-t-error-out-if-CROSS_CO.patch b/recipes-kernel/zephyr-kernel/files/0001-Makefile.toolchain.yocto-Don-t-error-out-if-CROSS_CO.patch deleted file mode 100644 index 993fe44..0000000 --- a/recipes-kernel/zephyr-kernel/files/0001-Makefile.toolchain.yocto-Don-t-error-out-if-CROSS_CO.patch +++ /dev/null @@ -1,26 +0,0 @@ -If CROSS_COMPILE is set, that means the user is trying to specify the -compiler manually. So don't error out when YOCTO_SDK_INSTALL_DIR isn't -set but CROSS_COMPILE is set. - -Signed-off-by: Juro Bystricky ---- -diff --git a/scripts/Makefile.toolchain.zephyr b/scripts/Makefile.toolchain.zephyr -index b964abf..69093f3 100644 ---- a/scripts/Makefile.toolchain.zephyr -+++ b/scripts/Makefile.toolchain.zephyr -@@ -12,6 +12,7 @@ - # - ####################################################################### - -+ifndef CROSS_COMPILE - REQUIRED_SDK_VER=0.8.2 - - ifndef ZEPHYR_SDK_INSTALL_DIR -@@ -25,6 +26,7 @@ ifeq ($(SDK_CHECK),1) - $(error (The SDK version you are using is old, please update your SDK. You need at least SDK version $(REQUIRED_SDK_VER))) - endif - endif -+endif - - ifeq ($(HOST_OS),MINGW) - TOOLCHAIN_HOME = ${ZEPHYR_SDK_INSTALL_DIR}/sysroots/i686-pokysdk-mingw32 diff --git a/recipes-kernel/zephyr-kernel/files/Makefile.toolchain.yocto b/recipes-kernel/zephyr-kernel/files/Makefile.toolchain.yocto new file mode 100644 index 0000000..6f80ab7 --- /dev/null +++ b/recipes-kernel/zephyr-kernel/files/Makefile.toolchain.yocto @@ -0,0 +1,8 @@ + +LIBGCC_DIR = $(shell dirname `$(CC)gcc -print-libgcc-file-name`) +LIB_INCLUDE_DIR += -L $(LIBGCC_DIR) +#TOOLCHAIN_CFLAGS = -I $(SYSROOT)/usr/include +TOOLCHAIN_LIBS = gcc + +export LIB_INCLUDE_DIR CROSS_COMPILE TOOLCHAIN_LIBS +#export TOOLCHAIN_CFLAGS diff --git a/recipes-kernel/zephyr-kernel/zephyr-kernel.inc b/recipes-kernel/zephyr-kernel/zephyr-kernel.inc index b16071f..aa450ca 100644 --- a/recipes-kernel/zephyr-kernel/zephyr-kernel.inc +++ b/recipes-kernel/zephyr-kernel/zephyr-kernel.inc @@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" # tag v1.6.0 SRCREV="d4e799d77a36eaf6d678b357c207411ec32b2d62" SRC_URI = "git://gerrit.zephyrproject.org/r/zephyr.git;protocol=https;branch=v1.6.0-branch" -SRC_URI += "file://0001-Makefile.toolchain.yocto-Don-t-error-out-if-CROSS_CO.patch" +SRC_URI += "file://Makefile.toolchain.yocto" PV = "1.6.0" @@ -14,5 +14,6 @@ S = "${WORKDIR}/git" # filesystem. IMAGE_NO_MANIFEST = "1" -BOARD_arm ?= "qemu_cortex_m3" -BOARD_x86 ?= "qemu_x86" +do_compile_prepend() { + cp ${WORKDIR}/Makefile.toolchain.yocto ${S}/scripts +}