diff --git a/meta-oniro-core/recipes-devtools/gcc/gcc-cross_11.2.bbappend b/meta-oniro-core/recipes-devtools/gcc/gcc-cross_11.2.bbappend
new file mode 100644
index 0000000000000000000000000000000000000000..7592dfd04300eae80a9138bfbb67122aefa331a9
--- /dev/null
+++ b/meta-oniro-core/recipes-devtools/gcc/gcc-cross_11.2.bbappend
@@ -0,0 +1,14 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+do_configure:prepend () {
+    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
+}