麻烦交叉编译 Python 2 Xcode:kivy-ios 分发抛出错误

Posted

技术标签:

【中文标题】麻烦交叉编译 Python 2 Xcode:kivy-ios 分发抛出错误【英文标题】:trouble cross-compiling Python 2 Xcode: kivy-ios distribution throwing error 【发布时间】:2013-09-25 04:24:40 【问题描述】:

我正在尝试从this tutorial 编译 kity-ios。但在运行tools/build-all.sh 后,我收到以下错误:

编辑:

(...)
checking for armv7-apple-darwin-gcc...  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
checking whether the C compiler works... no
configure: error: in `/Users/marcelosalloum/Projects/kivy-ios/tmp/Python-2.7.1':
configure: error: C compiler cannot create executables
See `config.log' for more details.

当我检查 config.log 文件时,它显示:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by python configure 2.7, which was
generated by GNU Autoconf 2.65.  Invocation command line was

  $ ./configure CC= /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 LD=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld CFLAGS=-march=armv7 -mcpu=arm176jzf -mcpu=cortex-a8 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0 -O3 LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0 -Lextralibs/ -lsqlite3 --without-pymalloc --disable-toolbox-glue --host=armv7-apple-darwin --prefix=/python --without-doc-strings

## --------- ##
## Platform. ##
## --------- ##

hostname = MacBook-Pro-de-Marcelo-Salloum.local
uname -m = x86_64
uname -r = 12.5.0
uname -s = Darwin
uname -v = Darwin Kernel Version 12.5.0: Mon Jul 29 16:33:49 PDT 2013; root:xnu-2050.48.11~1/RELEASE_X86_64

/usr/bin/uname -p = i386
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
     Darwin Kernel Version 12.5.0: Mon Jul 29 16:33:49 PDT 2013; root:xnu-2050.48.11~1/RELEASE_X86_64
Kernel configured for up to 2 processors.
2 processors are physically available.
2 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1
Primary memory available: 4.00 gigabytes
Default processor set: 122 tasks, 600 threads, 2 processors
Load average: 1.76, Mach factor: 0.43
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /Library/Frameworks/Python.framework/Versions/2.7/bin
PATH: /opt/local/bin
PATH: /opt/local/sbin
PATH: /Library/Frameworks/Python.framework/Versions/2.7/bin
PATH: /Library/Frameworks/Python.framework/Versions/Current/bin
PATH: /opt/local/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin
PATH: /opt/X11/bin
PATH: /usr/local/git/bin
PATH: /usr/texbin
PATH: /Users/marcelosalloum/gsutil
PATH: /usr/local/mysql/bin
PATH: /opt/local/bin/gcc-mp-4.8
PATH: /usr/local/bin
PATH: /usr/local/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2747: checking for --enable-universalsdk
configure:2788: result: no
configure:2797: checking for --with-universal-archs
configure:2814: result: 32-bit
configure:2971: checking MACHDEP
configure:3119: result: darwin
configure:3125: checking EXTRAPLATDIR
configure:3140: result: $(PLATMACDIRS)
configure:3151: checking machine type as reported by uname -m
configure:3154: result: x86_64
configure:3167: checking for --without-gcc
configure:3211: result: no
configure:3232: checking for armv7-apple-darwin-gcc
configure:3259: result:  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
configure:3528: checking for C compiler version
configure:3537:  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 --version >&5
./configure: line 3539: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2: No such file or directory
configure:3548: $? = 127
configure:3537:  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 -v >&5
./configure: line 3539: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2: No such file or directory
configure:3548: $? = 127
configure:3537:  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 -V >&5
./configure: line 3539: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2: No such file or directory
configure:3548: $? = 127
configure:3537:  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 -qversion >&5
./configure: line 3539: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2: No such file or directory
configure:3548: $? = 127
configure:3568: checking whether the C compiler works
configure:3590:  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 -march=armv7 -mcpu=arm176jzf -mcpu=cortex-a8 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0 -O3 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0 -Lextralibs/ -lsqlite3 conftest.c  >&5
./configure: line 3592: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2: No such file or directory
configure:3594: $? = 127
configure:3632: result: no
configure: failed program was:
| /* confdefs.h */
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _BSD_TYPES 1
| #define _DARWIN_C_SOURCE 1
| /* end confdefs.h.  */
| 
| int
| main ()
| 
| 
|   ;
|   return 0;
| 
configure:3637: error: in `/Users/marcelosalloum/Projects/kivy-ios/tmp/Python-2.7.1':
configure:3641: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=set
ac_cv_env_CC_value=' /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2'
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-march=armv7 -mcpu=arm176jzf -mcpu=cortex-a8 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0 -O3'
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value='-I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/'
ac_cv_env_CPP_set=set
ac_cv_env_CPP_value=' /usr/bin/cpp -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/'
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0 -Lextralibs/ -lsqlite3'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=armv7-apple-darwin
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_prog_CC=' /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2'

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR=''
ARCH_RUN_32BIT=''
ARFLAGS=''
BASECFLAGS=''
BLDLIBRARY=''
BLDSHARED=''
BUILDEXEEXT=''
CC=' /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2'
CCSHARED=''
CFLAGS='-march=armv7 -mcpu=arm176jzf -mcpu=cortex-a8 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0 -O3'
CFLAGSFORSHARED=''
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=''
CONFIG_ARGS=' '\''CC= /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2'\'' '\''LD=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld'\'' '\''CFLAGS=-march=armv7 -mcpu=arm176jzf -mcpu=cortex-a8 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0 -O3'\'' '\''LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0 -Lextralibs/ -lsqlite3'\'' '\''--without-pymalloc'\'' '\''--disable-toolbox-glue'\'' '\''--host=armv7-apple-darwin'\'' '\''--prefix=/python'\'' '\''--without-doc-strings'\'' '\''host_alias=armv7-apple-darwin'\'' '\''CPPFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/'\'' '\''CPP= /usr/bin/cpp -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/'\'''
CPP=' /usr/bin/cpp -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/'
CPPFLAGS='-I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/'
CXX=''
DEFS=''
DLINCLDIR=''
DLLLIBRARY=''
DYNLOADFILE=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
EXEEXT=''
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
EXTRAMACHDEPPATH='$(PLATMACPATH)'
EXTRAPLATDIR='$(PLATMACDIRS)'
FRAMEWORKALTINSTALLFIRST=''
FRAMEWORKALTINSTALLLAST=''
FRAMEWORKINSTALLAPPSPREFIX=''
FRAMEWORKINSTALLFIRST=''
FRAMEWORKINSTALLLAST=''
FRAMEWORKUNIXTOOLSPREFIX='/python'
GNULD=''
GREP=''
HAVE_GETHOSTBYNAME=''
HAVE_GETHOSTBYNAME_R=''
HAVE_GETHOSTBYNAME_R_3_ARG=''
HAVE_GETHOSTBYNAME_R_5_ARG=''
HAVE_GETHOSTBYNAME_R_6_ARG=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
INSTSONAME=''
LDCXXSHARED=''
LDFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0 -Lextralibs/ -lsqlite3'
LDLAST=''
LDLIBRARY=''
LDLIBRARYDIR=''
LDSHARED=''
LIBC=''
LIBFFI_INCLUDEDIR=''
LIBM=''
LIBOBJS=''
LIBRARY=''
LIBS=''
LIBTOOL_CRUFT=''
LINKCC=''
LINKFORSHARED=''
LIPO_32BIT_FLAGS=''
LN=''
LTLIBOBJS=''
MACHDEP='darwin'
MACHDEP_OBJS=''
MAINCC=''
OBJEXT=''
OPT=''
OTHER_LIBTOOL_OPT=''
PACKAGE_BUGREPORT='http://bugs.python.org/'
PACKAGE_NAME='python'
PACKAGE_STRING='python 2.7'
PACKAGE_TARNAME='python'
PACKAGE_URL=''
PACKAGE_VERSION='2.7'
PATH_SEPARATOR=':'
PKG_CONFIG=''
PYTHONFRAMEWORK=''
PYTHONFRAMEWORKDIR='no-framework'
PYTHONFRAMEWORKIDENTIFIER='org.python.python'
PYTHONFRAMEWORKINSTALLDIR=''
PYTHONFRAMEWORKPREFIX=''
RANLIB=''
RUNSHARED=''
SGI_ABI=''
SHELL='/bin/sh'
SHLIBS=''
SIGNAL_OBJS=''
SO=''
SOVERSION='1.0'
SRCDIRS=''
SVNVERSION=''
THREADHEADERS=''
THREADOBJ=''
TRUE=''
UNICODE_OBJS=''
UNIVERSALSDK=''
UNIVERSAL_ARCH_FLAGS=''
USE_SIGNAL_MODULE=''
USE_THREAD_MODULE=''
VERSION='2.7'
ac_ct_CC=''
bindir='$exec_prefix/bin'
build_alias=''
datadir='$datarootdir'
datarootdir='$prefix/share'
docdir='$datarootdir/doc/$PACKAGE_TARNAME'
dvidir='$docdir'
exec_prefix='NONE'
host_alias='armv7-apple-darwin'
htmldir='$docdir'
includedir='$prefix/include'
infodir='$datarootdir/info'
libdir='$exec_prefix/lib'
libexecdir='$exec_prefix/libexec'
localedir='$datarootdir/locale'
localstatedir='$prefix/var'
mandir='$datarootdir/man'
oldincludedir='/usr/include'
pdfdir='$docdir'
prefix='/python'
program_transform_name='s,x,x,'
psdir='$docdir'
sbindir='$exec_prefix/sbin'
sharedstatedir='$prefix/com'
sysconfdir='$prefix/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define _GNU_SOURCE 1
#define _NETBSD_SOURCE 1
#define __BSD_VISIBLE 1
#define _BSD_TYPES 1
#define _DARWIN_C_SOURCE 1

configure: exit 77

重要的是要知道我是通过 Macports 安装 kivy 依赖项,而不是推荐的 Homebrew。尽管我认为它会起作用。

编辑:

脚本在/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 中搜索arm llvm 编译器,但此路径中不存在此文件。我怎样才能找到它或如何解决这个问题?

【问题讨论】:

我在这里遇到同样的事情,问题发生在 build-python.sh 中:尝试 ./configure CC="$ARM_CC" LD="$ARM_LD" \ CFLAGS="$ARM_CFLAGS " \ LDFLAGS="$ARM_LDFLAGS -Lextralibs/ -lsqlite3" \ --without-pymalloc \ --disable-toolbox-glue \ --host=armv7-apple-darwin \ --prefix=/python \ --without-doc -字符串 This page 帮我在 /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ 中找到它 【参考方案1】:

我在我的 Mac 上对其进行了测试。得到同样的错误。也许你应该按照食谱使用 brew?正确理解我:如果维护者这样写,我相信这是由于某种原因。也许你问他?我自己之前没有使用过 brew,但是this page 说它比 fink 和 macports 的侵入性要小,所以你可以试一试。没有任何保证... ;-)

【讨论】:

【参考方案2】:

此问题已由 Mathieu Virbel 在 https://github.com/kivy/kivy-ios/issues/63 中修复

【讨论】:

以上是关于麻烦交叉编译 Python 2 Xcode:kivy-ios 分发抛出错误的主要内容,如果未能解决你的问题,请参考以下文章

armv8 aarch64 交叉编译 ffmpeg

windows和ubuntu虚拟机设置共享文件夹,在windows中用source insight阅读和编写代码,在linux中用交叉编译工具编译。

交叉编译Python-2.7.13到ARM(aarch32)—— 支持sqlite3

那些奇葩python模块怎么交叉编译呀

如何Ubuntu配置多个交叉编译工具??

嵌入式交叉编译