[meta-zephyr][PATCH 1/2] zephyr-qemuboot.bbclass: Don't overwrite the entire elf dictionary key


Andrei Gherzan
 

From: Andrei Gherzan <andrei.gherzan@huawei.com>

The nios2_machdata_setfunc was overwriting the elf key in matchdata for
arc done in arc_machdata_setfunc which in turn was overwriting the one
from oe-core. This is making qemu-x86 builds (as an example)
unbuildable:

Exception: KeyError: 'i586'

This patch makes sure that the changes complement the machdata
dictionary as opposed to overwriting the entire "elf" key.

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
---
classes/siteinfo-zephyr.bbclass | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/classes/siteinfo-zephyr.bbclass b/classes/siteinfo-zephyr.bbclass
index d84fd3a..b84a9b2 100644
--- a/classes/siteinfo-zephyr.bbclass
+++ b/classes/siteinfo-zephyr.bbclass
@@ -1,4 +1,3 @@
-
def arc_siteinfo_setfunc(archinfo, osinfo, targetinfo, d):
archinfo['arc'] = "endian-little bit-32 "
osinfo['linux'] = "common-linux common-glibc"
@@ -8,7 +7,7 @@ def arc_siteinfo_setfunc(archinfo, osinfo, targetinfo, d):
SITEINFO_EXTRA_DATAFUNCS += "arc_siteinfo_setfunc"

def arc_machdata_setfunc(machdata, d):
- machdata["elf"] = { "arc" : (195, 0, 0, True, 32), }
+ machdata["elf"]["arc"] = (195, 0, 0, True, 32)
return machdata

PACKAGEQA_EXTRA_MACHDEFFUNCS += "arc_machdata_setfunc"
@@ -22,7 +21,7 @@ def iamcu_siteinfo_setfunc(archinfo, osinfo, targetinfo, d):
SITEINFO_EXTRA_DATAFUNCS += "iamcu_siteinfo_setfunc"

def nios2_machdata_setfunc(machdata, d):
- machdata["elf"] = {"nios2": (113, 0, 0, True, 32), }
+ machdata["elf"]["nios2"] = (113, 0, 0, True, 32)
return machdata

-PACKAGEQA_EXTRA_MACHDEFFUNCS += "nios2_machdata_setfunc"
\ No newline at end of file
+PACKAGEQA_EXTRA_MACHDEFFUNCS += "nios2_machdata_setfunc"
--
2.31.1