Skip to contentSkip to conversation

New: python (built for powerpc) distutils has paths to host compiler toolchain

Buildroot bugzilla at busybox.net 1 participant 5 messages Jan 21, 2012 – Jul 10, 2013

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=4718

Summary: python (built for powerpc) distutils has paths to host
compiler toolchain
Product: buildroot
Version: 2011.11
Platform: PC
OS/Version: Linux
Status: NEW
Severity: minor
Priority: P5
Component: Other
AssignedTo: unassigned at buildroot.uclibc.org
ReportedBy: bvwelch at gmail.com
CC: buildroot at uclibc.org
Estimated Hours: 0.0

I suspect that I probably missed somewhere that I could have set this up, and I think I can workaround it using distutil.cfg, but I was surprised that when I ran "python setup.py build_ext --inplace", the errors were showing path names from the host where I ran buildroot, rather than my native powerpc toolchain.

Otherwise, buildroot is working great, thank you!

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#1 lore raw

[Buildroot] [Bug 4718] python (built for powerpc) distutils has paths to host compiler toolchain

https://bugs.busybox.net/show_bug.cgi?id=4718

--- Comment #1 from Thomas Petazzoni <[email protected]> 2012-01-31 19:43:30 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?

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 4718] python (built for powerpc) distutils has paths to host compiler toolchain

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=4718

--- Comment #2 from William Welch <[email protected]> 2012-02-01 17:23:06 UTC --- (In reply to comment #1)

Quoted 4 lines

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

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#3 lore raw

[Buildroot] [Bug 4718] python (built for powerpc) distutils has paths to host compiler toolchain

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=4718

Thomas Petazzoni <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at buildroot.uclibc |gustavo at zacarias.com.ar
|.org |

--- Comment #3 from Thomas Petazzoni <[email protected]> 2013-05-26 10:54:21 UTC --- Giving this bug to Gustavo, since he's been working on Python cross-compilation issues recently.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#4 lore raw

[Buildroot] [Bug 4718] python (built for powerpc) distutils has paths to host compiler toolchain

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=4718

Gustavo Zacarias <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #4 from Gustavo Zacarias <[email protected]> 2013-07-10 13:18:00 UTC --- 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.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.