Cannot successfully cross compile python-2.6.5 and greater with toolchain mipsel-r3000-linux-uclibc Reproducible: Always Steps to Reproduce: 1. CROSS_COMPILE="mipsel-r3000-linux-uclibc-" ARCH="mipsel" NOCOLOR="y" MAKEOPTS="-j1" CFLAGS="-O2 -mips32 -pipe" CXXFLAGS="${CFLAGS}" USE="-X -nls -xml -ipv6" mipsel-r3000-linux-uclibc-emerge python 2. - 3. - Actual Results: configure: creating ./config.status config.status: creating Makefile.pre config.status: creating Modules/Setup.config config.status: creating Misc/python.pc config.status: creating Modules/ld_so_aix config.status: creating pyconfig.h creating Modules/Setup creating Modules/Setup.local creating Makefile >>> Source configured. >>> Compiling source in /usr/mipsel-r3000-linux-uclibc/tmp/portage/dev-lang/python-2.7.1-r1/work/Python-2.7.1 ... make -j1 EPYTHON=python2 mipsel-r3000-linux-uclibc-gcc -c -fno-strict-aliasing -O2 -mips32 -pipe -DNDEBUG -I. -IInclude -I./Include -fPIC -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c In file included from Include/Python.h:58, from ./Modules/python.c:3: Include/pyport.h:243:13: #error "This platform's pyconfig.h needs to define PY_FORMAT_LONG_LONG" make: *** [Modules/python.o] Error 1 emake failed * ERROR: dev-lang/python-2.7.1-r1 failed (compile phase): * emake failed * * Call stack: * ebuild.sh, line 56: Called src_compile * environment, line 5476: Called die * The specific snippet of code: * emake EPYTHON="python${PV%%.*}" || die "emake failed" * * If you need support, post the output of 'emerge --info =dev-lang/python-2.7.1-r1', * the complete build log and the output of 'emerge -pqv =dev-lang/python-2.7.1-r1'. * The complete build log is located at '/usr/mipsel-r3000-linux-uclibc/tmp/portage/dev-lang/python-2.7.1-r1/temp/build.log'. * The ebuild environment file is located at '/usr/mipsel-r3000-linux-uclibc/tmp/portage/dev-lang/python-2.7.1-r1/temp/environment'. * S: '/usr/mipsel-r3000-linux-uclibc/tmp/portage/dev-lang/python-2.7.1-r1/work/Python-2.7.1' Expected Results: >>> Installing (1 of 1) dev-lang/python-2.7.1-r1 * Compilation and optimization of Python modules placed outside of site-packages directories for CPython 2.7 ... [ ok ] >>> Recording dev-lang/python:2.7 in "world" favorites file... >>> Auto-cleaning packages... >>> No outdated packages were found on your system. * GNU info directory index is up-to-date. /usr/mipsel-r3000-linux-uclibc/etc/make.profile -> /usr/portage/profiles/uclibc/mips
Created attachment 276491 [details] the build log file
Please post your `(cross-)emerge --info' output too.
# CROSS_COMPILE="mipsel-r3000-linux-uclibc-" ARCH="mipsel" NOCOLOR="y" MAKEOPTS="-j1" CFLAGS="-O2 -mips32 -pipe" CXXFLAGS="${CFLAGS}" USE="-X -nls -xml -ipv6" mipsel-r3000-linux-uclibc-emerge --info PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2' PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2' PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2' PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2' PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2' PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2' PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2' PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2' Portage 2.1.9.42 (uclibc/mips, gcc-3.4.6, unavailable, 2.6.37-gentoo-r4 i686) ================================================================= System uname: Linux-2.6.37-gentoo-r4-i686-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-gentoo-2.0.2 Timestamp of tree: Tue, 14 Jun 2011 00:45:01 +0000 app-shells/bash: 4.1_p9 dev-lang/python: 2.7.1-r1, 3.1.3-r1 sys-apps/baselayout: 2.0.2 sys-apps/openrc: 0.8.2-r1 sys-apps/sandbox: 2.4 sys-devel/autoconf: 2.65-r1 sys-devel/automake: 1.11.1 sys-devel/binutils: 2.20.1-r1 sys-devel/gcc: 4.4.5 sys-devel/gcc-config: 1.4.1-r1 sys-devel/libtool: 2.2.10 sys-devel/make: 3.81-r2 sys-kernel/linux-headers: 2.6.36.1 sys-libs/glibc: 2.12.2 virtual/os-headers: 0 ACCEPT_KEYWORDS="mips ~mips" ACCEPT_LICENSE="* -@EULA" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -mips32 -pipe" CHOST="mipsel-r3000-linux-uclibc" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-2.2/conf /usr/share/maven-bin-3.0/conf /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -mips32 -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--nospinner" FEATURES="assume-digests binpkg-logs buildpkg distlocks fixlafiles fixpackages news nodoc noinfo noman parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="http://gentoo.mirror.ac.za http://gentoo.mirrors.easynews.com http://mirror.bytemark.co.uk/gentoo" LANG="af_ZA.utf-8" LC_ALL="af_ZA.utf-8" LDFLAGS="-L/usr/mipsel-r3000-linux-uclibc/lib -L/usr/mipsel-r3000-linux-uclibc/usr/lib" MAKEOPTS="-j1" PKGDIR="/usr/mipsel-r3000-linux-uclibc/packages/" PORTAGE_CONFIGROOT="/usr/mipsel-r3000-linux-uclibc/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/usr/mipsel-r3000-linux-uclibc/tmp/" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="bindist cli cracklib crypt cxx dri make-symlinks minimal mips modules mudflap ncurses openmp pcre perl python readline session ssl tcpd uclibc xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="uclibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
cat /usr/mipsel-r3000-linux-uclibc/etc/make.conf # These settings were set by the catalyst build script that automatically # built this stage. # Please consult /usr/share/portage/config/make.conf.example for a more # detailed example. CFLAGS="-O2 -mips32 -pipe -Wa" CXXFLAGS="${CFLAGS}" # WARNING: Changing your CHOST is not something that should be done lightly. # Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing. CHOST="mipsel-r3000-linux-uclibc" #ARCH="mipsel" #CROSS_COMPILE="mipsel-r3000-linux-uclibc-" EMERGE_DEFAULT_OPTS="--nospinner" AUTOCLEAN="yes" MAKEOPTS="-j3" USE="ipv6 -nls -X"
hint the same problem, and found this patch, anyone tried this? http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
I can confirm this when cross-emerging python-2.7.1-r1 for armv5tel-softfloat-linux-gnueabi using crossdev. This seems to be a bug in the python build (?) since ./configure says "checking for long long support... yes" and pyconfig.h contains "#define HAVE_LONG_LONG 1" but also "/* #undef PY_FORMAT_LONG_LONG */"
You need to override default autoconf assumption : # cat /usr/i586-alix-linux-gnu/etc/portage/env/dev-lang/python export ac_cv_have_long_long_format=yes
*** This bug has been marked as a duplicate of bug 362945 ***