From: Adrian Freihofer <[email protected]>

RECIPE_SYSROOT can retain a gcc-<old-version>/python directory left
over from before a gcc version bump, since sysroot cleanup does not
always remove it. gdb_pretty_print_scripts globbed usr/share/gcc-*/python
and silently picked the first match, which could be the stale, no
longer matching version, breaking libstdc++ pretty-printing in gdb
(register_libstdcxx_printers) without an obvious cause.

Raise a DevtoolError when the glob matches more than one directory
instead of guessing, and tell the user to remove tmp/work and rebuild
the recipe.

Signed-off-by: Adrian Freihofer <[email protected]>
---
 scripts/lib/devtool/ide_sdk.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/lib/devtool/ide_sdk.py b/scripts/lib/devtool/ide_sdk.py
index ab2bba5d39..4fdeeec24d 100755
--- a/scripts/lib/devtool/ide_sdk.py
+++ b/scripts/lib/devtool/ide_sdk.py
@@ -817,6 +817,11 @@ class RecipeModified:
             if self.toolchain == "gcc":
                 gcc_python_helpers_pattern = os.path.join(self.recipe_sysroot, 
"usr", "share", "gcc-*", "python")
                 gcc_python_helpers_dirs = glob.glob(gcc_python_helpers_pattern)
+                if len(gcc_python_helpers_dirs) > 1:
+                    raise DevtoolError(
+                        "Found multiple gcc python helpers directories 
matching %s: %s. "
+                        "The recipe sysroot likely has stale files from a 
previous gcc version, "
+                        "remove tmp/work and rebuild the recipe." % 
(gcc_python_helpers_pattern, gcc_python_helpers_dirs))
                 if gcc_python_helpers_dirs:
                     gcc_python_helpers = gcc_python_helpers_dirs[0]
                 else:
-- 
2.55.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#243787): 
https://lists.openembedded.org/g/openembedded-core/message/243787
Mute This Topic: https://lists.openembedded.org/mt/120837848/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to