This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Cross compilation fail for ARM
Type: compile error Stage: resolved
Components: Cross-Build Versions: Python 2.7
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Alex.Willmer, n0s69z, pmpp
Priority: normal Keywords:

Created on 2018-06-22 10:51 by n0s69z, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
targetpython_build.log n0s69z, 2018-06-22 10:51 Build log tor target python build
Messages (3)
msg320222 - (view) Author: David (n0s69z) Date: 2018-06-22 10:51
Hi all,

I fail on cross compiling Python 2.7.14 for ARM using a self built toolchain.

Build host: Linux x86-64 CentOS 7
Target: arm cortex-a9

My steps are compiling python for the host, after that compiling python for the target using the PYTHON_FOR_BUILD flag with the prior built python.

Compile settings:

cd /home/op/Projekte/Cross_Linux/src/Python-2.7.15 && ./configure --host=arm-cortexa9_neon-linux-gnueabihf ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no ac_cv_have_long_long_format=yes --enable-shared --disable-ipv6 --build=x86_64-pc-linux-gnu PYTHON_FOR_BUILD=/home/op/Projekte/Cross_Linux/hostsrc/../root/bin/python --prefix=/home/op/Projekte/Cross_Linux/src/Python-2.7.15/_install || exit 11 ;\
	make -C /home/op/Projekte/Cross_Linux/src/Python-2.7.15 V=1 || exit 12 ;\
	make -C /home/op/Projekte/Cross_Linux/src/Python-2.7.15 install V=1 || exit 13 ;\

Last snippet from the build log for the target:

building 'ossaudiodev' extension
arm-cortexa9_neon-linux-gnueabihf-gcc -fPIC -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I. -IInclude -I/usr/local/include -I/usr/include/python2.7 -c ossaudiodev.c -o build/temp.linux-x86_64-2.7/ossaudiodev.o
arm-cortexa9_neon-linux-gnueabihf-gcc: Fehler: nicht erkanntes Kommandozeilenargument in Option »-mtune=generic«
arm-cortexa9_neon-linux-gnueabihf-gcc: Anmerkung: gültige Argumente für »-mtune=« sind: arm1020e arm1020t arm1022e arm1026ej-s arm10e arm10tdmi arm1136j-s arm1136jf-s arm1156t2-s arm1156t2f-s arm1176jz-s arm1176jzf-s arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm70 arm700 arm700i arm710 arm7100 arm710c arm710t arm720 arm720t arm740t arm7500 arm7500fe arm7d arm7di arm7dm arm7dmi arm7m arm7tdmi arm7tdmi-s arm8 arm810 arm9 arm920 arm920t arm922t arm926ej-s arm940t arm946e-s arm966e-s arm968e-s arm9e arm9tdmi cortex-a12 cortex-a15 cortex-a15.cortex-a7 cortex-a5 cortex-a53 cortex-a57 cortex-a57.cortex-a53 cortex-a7 cortex-a8 cortex-a9 cortex-m0 cortex-m0plus cortex-m1 cortex-m3 cortex-m4 cortex-r4 cortex-r4f cortex-r5 cortex-r7 ep9312 fa526 fa606te fa626 fa626te fa726te fmp626 generic-armv7-a iwmmxt iwmmxt2 marvell-pj4 mpcore mpcorenovfp native strongarm strongarm110 strongarm1100 strongarm1110 xscale
arm-cortexa9_neon-linux-gnueabihf-gcc: Fehler: nicht erkanntes Kommandozeilenargument in Option »-mtune=generic«
arm-cortexa9_neon-linux-gnueabihf-gcc: Anmerkung: gültige Argumente für »-mtune=« sind: arm1020e arm1020t arm1022e arm1026ej-s arm10e arm10tdmi arm1136j-s arm1136jf-s arm1156t2-s arm1156t2f-s arm1176jz-s arm1176jzf-s arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm70 arm700 arm700i arm710 arm7100 arm710c arm710t arm720 arm720t arm740t arm7500 arm7500fe arm7d arm7di arm7dm arm7dmi arm7m arm7tdmi arm7tdmi-s arm8 arm810 arm9 arm920 arm920t arm922t arm926ej-s arm940t arm946e-s arm966e-s arm968e-s arm9e arm9tdmi cortex-a12 cortex-a15 cortex-a15.cortex-a7 cortex-a5 cortex-a53 cortex-a57 cortex-a57.cortex-a53 cortex-a7 cortex-a8 cortex-a9 cortex-m0 cortex-m0plus cortex-m1 cortex-m3 cortex-m4 cortex-r4 cortex-r4f cortex-r5 cortex-r7 ep9312 fa526 fa606te fa626 fa626te fa726te fmp626 generic-armv7-a iwmmxt iwmmxt2 marvell-pj4 mpcore mpcorenovfp native strongarm strongarm110 strongarm1100 strongarm1110 xscale
arm-cortexa9_neon-linux-gnueabihf-gcc: Fehler: ossaudiodev.c: Datei oder Verzeichnis nicht gefunden
arm-cortexa9_neon-linux-gnueabihf-gcc: Fehler: nicht erkannte Kommandozeilenoption »-m64«
arm-cortexa9_neon-linux-gnueabihf-gcc: Fehler: nicht erkannte Kommandozeilenoption »-m64«
arm-cortexa9_neon-linux-gnueabihf-gcc: schwerwiegender Fehler: keine Eingabedateien
Kompilierung beendet.
error: /builddir/build/BUILD/Python-2.7.5/Modules/_ctypes/libffi: No such file or directory
make[1]: *** [sharedmods] Fehler 1

I can't get rid of the wrong compiler flags -m64 and -mtune=generic.

Target python build log attached.
msg320224 - (view) Author: pmp-p (pmpp) * Date: 2018-06-22 11:24
Hi, in the log i see : checking for --with-system-ffi... no

if you are sure your target ffi is ok then that could look a lot like what i had for python3 cross compile to armv7 android with a self built toolchain too : https://bugs.python.org/issue31710. iirc forcing libffi detection in setup.py helped.
msg320590 - (view) Author: David (n0s69z) Date: 2018-06-27 14:50
After using --with-system-ffi and setting the correct LD_LIBRARY_PATH, it worked.

Many thanks for the help!
History
Date User Action Args
2022-04-11 14:59:02adminsetgithub: 78119
2018-06-27 14:50:16n0s69zsetstatus: open -> closed

messages: + msg320590
stage: resolved
2018-06-22 11:24:04pmppsetnosy: + pmpp
messages: + msg320224
2018-06-22 10:51:53n0s69zcreate