Hi,
I download the newest aarch64 linux toolchain(version 12.3) from:
https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-aarch64-arm-none-eabi.tar.xz?rev=420215e7c8d14d90b5227eb5486d8c75&hash=315EF6A79273453E2306E2E9F52D80E1
When I exec the command
aarch64-none-linux-gnu-gdb
It shows:
Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Python path configuration: PYTHONHOME = (not set) PYTHONPATH = (not set) program name = '/usr/local/bld-tools/bld-tools-virtual-env/bin/python' isolated = 0 environment = 1 user site = 1 import site = 1 sys._base_executable = '/usr/local/bld-tools/bld-tools-virtual-env/bin/python' sys.base_prefix = '/usr' sys.base_exec_prefix = '/usr' sys.executable = '/usr/local/bld-tools/bld-tools-virtual-env/bin/python' sys.prefix = '/usr' sys.exec_prefix = '/usr' sys.path = [ '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/lib-dynload', ] Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings' Current thread 0x00007f1c07ce7c00 (most recent call first): <no Python frame>
My machine is ubuntu2204 and the default python is 3.10.12.
So I set the PYTHONPATH and PATHONHOME to:
export PYTHONPATH=/usr/bin/:~/.local/lib/python3.10/:/usr/lib/python3.10/ export PYTHONHOME=/usr/bin/
Then it shows:
Fatal Python error: init_sys_streams: can't initialize sys standard streams Python runtime state: core initialized Traceback (most recent call last): File "/usr/lib/python3.10/io.py", line 54, in <module> ImportError: cannot import name 'text_encoding' from 'io' (unknown location)
Does Anybody have ideas? Thanks a lot.
Br,
Yingchun Li
Just more info, I used
strace aarch64-none-linux-gnu-gdb
There are a lot of info shows that aarch64-none-linux-gnu-gdb try to use the specific version python3.8?
some infos like this:
openat(AT_FDCWD, "/home/user/toolchain/gcc/arm-gnu-toolchain-12.3.rel1-x86_64-aarch64-none-linux-gnu/share/gdb/python/gdb/__pycache__/types.cpython-38.pyc", O_RDONLY|O_CLOEXEC)
So I change the default version to python3.8, Now it run into another problem when exec the command
aarch64-none-linux-gnu-gdb vmlinux
"
Reading symbols from vmlinux...Traceback (most recent call last): File "/home/user/work/mainline-linux/linux/vmlinux-gdb.py", line 30, in <module> import linux.config File "/home/user/work/mainline-linux/linux/scripts/gdb/linux/config.py", line 6, in <module> import zlibModuleNotFoundError: No module named 'zlib'
I give up the arm toolchain's gdb, and installed the gdb-multiarch, and that run smoothly.