I recently trying to compile crosstool-ng for my arm board. The host is Arch linux 3.9.4-1. I ran into these following issues:
[ALL ] checking for python... /usr/bin/python
[ALL ] File "/home/godard_b/workspace/raspberry_pi/staging/.build/src/gdb-7.4.1/gdb/python/python-config.py", line 47
[ALL ] print to_unix_path(sysconfig.PREFIX)
[ALL ] ^
[ALL ] SyntaxError: invalid syntax
[ERROR] configure: error: failure running python-config --includes
[ERROR] make[2]: *** [configure-gdb] Error 1
[ALL ] make[2]: Leaving directory `/home/godard_b/workspace/raspberry_pi/staging/.build/arm-unknown-linux-gnueabi/build/build-gdb-cross'
[ERROR] make[1]: *** [all] Error 2
[ALL ] make[1]: Leaving directory `/home/godard_b/workspace/raspberry_pi/staging/.build/arm-unknown-linux-gnueabi/build/build-gdb-cross'
[ERROR]
[ERROR] >>
[ERROR] >> Build failed in step 'Installing cross-gdb'
[ERROR] >> called in step '(top-level)'
[ERROR] >>
[ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@258]
[ERROR] >> called from: do_debug_gdb_build[scripts/build/debug/300-gdb.sh@177]
[ERROR] >> called from: do_debug[scripts/build/debug.sh@35]
[ERROR] >> called from: main[scripts/crosstool-NG.sh@609]
[ERROR] >>
[ERROR] >> For more info on this error, look at the file: 'build.log'
[ERROR] >> There is a list of known issues, some with workarounds, in:
[ERROR] >> '/usr/share/doc/crosstool-ng/ct-ng.1.17.0/B - Known issues.txt'
[ERROR]
[ERROR] (elapsed: 132:05.60)
When I run :
python-config --include
it just work fine, so I'm wondering where the problem could be. Thanks for your help.
I had the same issue, the problem is here:
[ALL ] print to_unix_path(sysconfig.PREFIX)
[ALL ] ^
[ALL ] SyntaxError: invalid syntax
Which means that it's using Python 3 instead of Python 2, probably because python points to python3 (Which is the default in Arch)k
To fix this issue, just make a new directory (I made one called bin on home) and make two symbolic links named python and python-config pointing at python2 and python2-config:
mkdir ~/bin
ln -s /bin/python2 ~/bin/python
ln -s /bin/python2-config ~/bin/python-config
Now try once again to build crosstool-ng adding the dir with python linking at python2 at the beginning of your PATH:
PATH=$HOME/bin:$PATH crosstool-ng build
Sources: https://wiki.archlinux.org/index.php/Python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With