| Summary: | python (built for powerpc) distutils has paths to host compiler toolchain | ||
|---|---|---|---|
| Product: | buildroot | Reporter: | William Welch <bvwelch> |
| Component: | Other | Assignee: | Gustavo Zacarias <gustavo> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | minor | CC: | buildroot |
| Priority: | P5 | ||
| Version: | 2011.11 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
|
Description
William Welch
2012-01-21 23:13:02 UTC
Python support for cross-compilation is quite horrible, so the problem may be quite hard to fix. Could you give some steps to reproduce what you are seeing? (In reply to comment #1) > Python support for cross-compilation is quite horrible, so the problem may be > quite hard to fix. > > Could you give some steps to reproduce what you are seeing? First, may I say that with some more research I found a workaround that is easy and works good. But, here is what happens without the workaround: python setup.py build_ext --inplace running build_ext building '_ncapio' extension creating build creating build/temp.linux-ppc-2.7 /home/bwelch/jan23a/buildroot-2011.11/output/host/usr/bin/powerpc-unknown-linux-uclibc-gcc -fno-strict-aliasing -pipe -Os -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c _ncapio.c -o build/temp.linux-ppc-2.7/_ncapio.o unable to execute /home/bwelch/jan23a/buildroot-2011.11/output/host/usr/bin/powerpc-unknown-linux-uclibc-gcc: No such file or directory error: command '/home/bwelch/jan23a/buildroot-2011.11/output/host/usr/bin/powerpc-unknown-linux-uclibc-gcc' failed with exit status 1 Note that instead of using my native powerpc 'gcc' and 'ld', somehow it tried to use pathnames from my host computer's cross-toolcain?? ------------------------ Now the simple workaround: export CC='gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions' export LDSHARED='ld -shared' running build_ext building '_ncapio' extension gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -fno-strict-aliasing -pipe -Os -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c _ncapio.c -o build/temp.linux-ppc-2.7/_ncapio.o ld -shared build/temp.linux-ppc-2.7/_ncapio.o -L/usr/lib -lpython2.7 -o /root/ncapio/_ncapio.so # works fine thank you! buildroot, python, native gcc all working great Giving this bug to Gustavo, since he's been working on Python cross-compilation issues recently. Target toolchain is deprecated so this bug is basically invalid/wontfix now. Building modules in the target isn't supported nor encouraged. *IF* you wanted to patch this for an older version of buildroot you'd need to tweak $(TARGET_DIR)/usr/lib/python2.7/config/Makefile and substitute the appropiate CC/CXX/AR/RANLIB/PYTHON_FOR_BUILD/PGEN_FOR_BUILD definitions to those matching the target. But it's completely unsupported, it may or may not work and might need additional tweaking. |