On Thu, Apr 7, 2022 at 02:32 PM, Richard Purdie wrote:
On Thu, 2022-04-07 at 14:26 +0200, Bernhard Rosenkränzer via
lists.openembedded.org wrote:
rename from meta/recipes-devtools/gcc/gcc-cross-canadian_11.2.bb
rename to meta/recipes-devtools/gcc/gcc-cross-canadian_12.0.bb
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index 3ffa1f0c46..0e8119384b 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -47,6 +47,15 @@ ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
do_configure:prepend () {
install -d ${RECIPE_SYSROOT}${target_includedir}
touch ${RECIPE_SYSROOT}${target_includedir}/limits.h
+
+ if ! echo ${@d.getVar("TARGET_OS")} | grep -qi linux; then
+ # Building Zephyr with DWARF-5 is problematic because
+ # its kernel tests use pyelftools, which has incomplete
+ # DWARF-5 support (even after applying preliminary
+ # support patches). Use DWARF-4 on Zephyr and FreeRTOS
+ # for the time being.
+ sed -i -e 's,Var(dwarf_version) Init(5),Var(dwarf_version) Init(4),' ${S}/gcc/common.opt
+ fi
}

do_compile () {
Unfortunately you can't do that. The gcc-cross is shared amongst all targets on
a given architecture. This will "kind of work" in that other sstate code will
clean it up and rebuild gcc but it isn't as designed and can't merge like that
I'm afraid.
True, didn't think of that. I've backed out this part and sent a new patch. Will address the zephyr problem with an added -gdwarf-4 flag in zephyr configs.

ttyl
bero