diff --git a/meta-python/recipes-devtools/python/python3-matplotlib_3.7.2.bb b/meta-python/recipes-devtools/python/python3-matplotlib_3.7.2.bb
index 72c369100a..2886060a9e 100644
--- a/meta-python/recipes-devtools/python/python3-matplotlib_3.7.2.bb
+++ b/meta-python/recipes-devtools/python/python3-matplotlib_3.7.2.bb
@@ -68,3 +68,8 @@ do_compile:prepend() {
 }
 
 BBCLASSEXTEND = "native"
+
+# otherwise pybind11 paths from STAGING_DIR_NATIVE end in _tri.cpython-312-i386-linux-gnu.so
+# when STAGING_DIR_NATIVE doesn't start with STAGING_DIR_HOST (e.g. for lib32-python3-matplotlib)
+# http://errors.yoctoproject.org/Errors/Details/801217/
+DEBUG_PREFIX_MAP:append = " -fmacro-prefix-map=${STAGING_DIR_NATIVE}="
