I do steps from the tutorial http://gentoo.mindzoo.de/index.cgi/wiki/cross-compiling after command emerge-armv4tl-softfloat-linux-gnueabi world compilation fails at ebuild dev-lang/python-3.1.1-r1 with message checking for chflags... configure: error: in `/usr/armv4tl-softfloat-linux-gnueabi/tmp/portage/dev-lang/python-3.1.1-r1/work/Python-3.1.1': configure: error: cannot run test program while cross compiling See `config.log' for more details.
Created attachment 217644 [details] /usr/armv4tl-softfloat-linux-gnueabi/tmp/portage/dev-lang/python-3.1.1-r1/temp/environment S: '/usr/armv4tl-softfloat-linux-gnueabi/tmp/portage/dev-lang/python-3.1.1-r1/work/Python-3.1.1'
Created attachment 217646 [details] emerge-armv4tl-softfloat-linux-gnueabi -pqv =dev-lang/python-3.1.1-r1
Created attachment 217648 [details] emerge-armv4tl-softfloat-linux-gnueabi --info =dev-lang/python-3.1.1-r1
Created attachment 217650 [details] /usr/armv4tl-softfloat-linux-gnueabi/tmp/portage/dev-lang/python-3.1.1-r1/work/Python-3.1.1/config.log
Created attachment 217652 [details] /usr/armv4tl-softfloat-linux-gnueabi/tmp/portage/dev-lang/python-3.1.1-r1/temp/build.log
I'm not sure if it helps, but there is an article: http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html That said, reassigning on maintainers.
there's already fixes for the chflags test, but only in the python-2.6 ebuilds at the moment
The fix will be included in 3.1.2: http://svn.python.org/view?view=rev&revision=77863
unless 3.1.2 is going to be released soonish, this should be added to 3.1.1
Reporter of this bug: Could you check if this patch is sufficient or if there are additional problems, which can be noticed after fixing of this problem?
When building for powerpc-unknown-gnu-linux, in addition to the already-patched chflags and printf configure checks, I see configure failures when checking for getaddrinfo() and sem_open() After working around these, the build works up until the source files in the Modules dir are compiled powerpc-unknown-linux-gnu-gcc -fPIC -DNDEBUG -Os -pipe -mcpu=cell -fomit-frame-pointer -I/usr/powerpc-unknown-linux-gnu/usr/include/ -I/usr/powerpc-unknown-linux-gnu/include/ -I/usr/include -I. -I./Include -I/usr/local/include -IInclude -I/usr/powerpc-unknown-linux-gnu/tmp/portage/dev-lang/python-3.1.1-r2/work/Python-3.1.1 -c -I/usr/include -I. -I./Include -I/usr/local/include -IInclude -I/usr/powerpc-unknown-linux-gnu/tmp/portage/dev-lang/python-3.1.1-r2/work/Python-3.1.1 -c /usr/powerpc-unknown-linux-gnu/tmp/portage/dev-lang/python-3.1.1-r2/work/Python-3.1.1/Modules/selectmodule.c -o build/temp.linux-x86_64-3.1/usr/powerpc-unknown-linux-gnu/tmp/portage/dev-lang/python-3.1.1-r2/work/Python-3.1.1/Modules/selectmodule.o /usr/powerpc-unknown-linux-gnu/tmp/portage/dev-lang/python-3.1.1-r2/work/Python-3.1.1/Modules/selectmodule.c: In function ‘seq2set’: /usr/powerpc-unknown-linux-gnu/tmp/portage/dev-lang/python-3.1.1-r2/work/Python-3.1.1/Modules/selectmodule.c:92: error: impossible constraint in ‘asm’ Note the presence of "-I/usr/include" in the command-line - the error corresponds to the use of the FD_OPEN() macro in selectmodule.c. An x86-optimised version is used. If I manually re-run the command without the -I/usr/include arg(s), there is no error. I cannot determine where in the build system this argument (-I/usr/include) is being added.
setup.py contains the following if os.path.normpath(sys.prefix) != '/usr': add_dir_to_list(self.compiler.library_dirs, sysconfig.get_config_var("LIBDIR")) add_dir_to_list(self.compiler.include_dirs, sysconfig.get_config_var("INCLUDEDIR")) which is what is adding /usr/include to the command line. Removing this gets me past this problem to the next one.
(In reply to comment #12) Please report it to upstream.
(In reply to comment #13) > (In reply to comment #12) > > Please report it to upstream. Sadly upstream is not responsive in the case of cross-compiles. Kinda a lack of understanding. Lets just fix it at gentoo.
python cross-compiling support is done in parallel -- fixed in Gentoo and reported upstream. simply dumping it as UPSTREAM isnt going to fly. going by the response here though, i'm guessing i'm just going to have to fix it myself again.
(In reply to comment #12) > setup.py contains the following > > if os.path.normpath(sys.prefix) != '/usr': > add_dir_to_list(self.compiler.library_dirs, > sysconfig.get_config_var("LIBDIR")) > add_dir_to_list(self.compiler.include_dirs, > sysconfig.get_config_var("INCLUDEDIR")) This code exists also in Python 2.4.*, 2.5.* and 2.6.*.
Fixed in 3.1.2.