构建用于iOS的python 2.7.1错误:无法计算sizeof(uintptr\u)

2024-05-23 18:49:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我在尝试生成Python 2.7 for iOS ARM64时遇到奇怪的错误:

checking size of int... 0
checking size of long... 0
checking size of void *... 0
checking size of short... 0
checking size of float... 0
checking size of double... 0
checking size of fpos_t... 0
checking size of size_t... 0
checking size of pid_t... 0
checking for long long support... yes
checking size of long long... 0
checking for long double support... yes
checking size of long double... 0
checking for _Bool support... yes
checking size of _Bool... 0
checking for uintptr_t... yes
checking size of uintptr_t... configure: error: in `/Users/asmirnov/Documents/dev/src/Python-iOS-support/build/Python-2.7.1/ios-arm64':
configure: error: cannot compute sizeof (uintptr_t)
See `config.log' for more details.

在配置日志公司名称:

^{pr2}$

_尺寸\u t.h:30:32

#ifndef _SIZE_T 
#define _SIZE_T 
typedef __darwin_size_t        size_t; 
#endif  /* _SIZE_T */

你知道怎么回事吗?在

完整的configure命令行是:

# Configure and build iPhone library
cd build/Python-2.7.1/ios-arm64 && ./configure CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" LD="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" CFLAGS="-arch arm64 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include -miphoneos-version-min=6.0 -I../../../dist/ffi.framework/Headers" LDFLAGS="-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/lib -miphoneos-version-min=6.0 -L../../../dist/ffi.framework/ -lsqlite3 -undefined dynamic_lookup" --without-pymalloc --disable-toolbox-glue --host=arm64-apple-darwin --prefix=/Users/asmirnov/Documents/dev/src/Python-iOS-support/build/python/ios-arm64 --without-doc-strings

注:所有“计算…的大小”以错误结束,例如:

configure:6610: checking size of int
configure:6615: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -c -arch arm64 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include -miphoneos-version-min=6.0 -I../../../dist/ffi.framework/Headers  conftest.c >&5
In file included from conftest.c:67:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/stdio.h:72:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/_types/_size_t.h:30:32: error: cannot combine with previous 'type-name' declaration specifier
typedef __darwin_size_t        size_t; 
                               ^
conftest.c:63:25: note: expanded from macro 'size_t'
#define size_t unsigned int
                        ^
In file included from conftest.c:67:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/stdio.h:72:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/_types/_size_t.h:30:32: error: 'type-name' cannot be signed or unsigned
conftest.c:63:16: note: expanded from macro 'size_t'
#define size_t unsigned int
               ^
In file included from conftest.c:67:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/stdio.h:411:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/_types/_off_t.h:30:25: error: cannot combine with previous 'type-name' declaration specifier
typedef __darwin_off_t          off_t;
                                ^
conftest.c:60:20: note: expanded from macro 'off_t'
#define off_t long int
                   ^
In file included from conftest.c:67:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/stdio.h:411:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/_types/_off_t.h:30:25: error: 'long type-name' is invalid
conftest.c:60:15: note: expanded from macro 'off_t'
#define off_t long int
              ^
In file included from conftest.c:69:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/types.h:108:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/_types/_gid_t.h:30:24: error: cannot combine with previous 'type-name' declaration specifier
typedef __darwin_gid_t  gid_t; 
                        ^
conftest.c:65:15: note: expanded from macro 'gid_t'
#define gid_t int
              ^
In file included from conftest.c:69:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/types.h:118:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/_types/_mode_t.h:30:26: error: cannot combine with previous 'type-name' declaration specifier
typedef __darwin_mode_t         mode_t;
                                ^
conftest.c:59:16: note: expanded from macro 'mode_t'
#define mode_t int
               ^
In file included from conftest.c:69:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/types.h:121:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/_types/_pid_t.h:30:31: error: cannot combine with previous 'type-name' declaration specifier
typedef __darwin_pid_t        pid_t; 
                              ^
conftest.c:61:15: note: expanded from macro 'pid_t'
#define pid_t int
              ^
In file included from conftest.c:69:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/types.h:127:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/_types/_uid_t.h:30:31: error: cannot combine with previous 'type-name' declaration specifier
typedef __darwin_uid_t        uid_t; 
                              ^
conftest.c:64:15: note: expanded from macro 'uid_t'
#define uid_t int
              ^
In file included from conftest.c:69:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/types.h:161:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/sys/_types/_clock_t.h:30:33: error: 'long type-name' is invalid
typedef __darwin_clock_t        clock_t;
                                ^
conftest.c:53:17: note: expanded from macro 'clock_t'
#define clock_t long
                ^
9 errors generated.
configure:6615: $? = 1
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
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_DLFCN_H 1
| #define HAVE_ERRNO_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_GRP_H 1
| #define HAVE_LANGINFO_H 1
| #define HAVE_POLL_H 1
| #define HAVE_PTHREAD_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_TERMIOS_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_UTIME_H 1
| #define HAVE_SYS_EVENT_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_LOCK_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_POLL_H 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_STATVFS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_TIMES_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_UN_H 1
| #define HAVE_SYS_UTSNAME_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_SYSEXITS_H 1
| #define HAVE_SPAWN_H 1
| #define HAVE_UTIL_H 1
| #define HAVE_DIRENT_H 1
| #define clock_t long
| #define _LARGEFILE_SOURCE 1
| #define _FILE_OFFSET_BITS 64
| #if defined(SCO_DS)
| #undef _OFF_T
| #endif
| #define mode_t int
| #define off_t long int
| #define pid_t int
| #define RETSIGTYPE void
| #define size_t unsigned int
| #define uid_t int
| #define gid_t int
| /* end confdefs.h.  */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)];
| test_array [0] = 0
| 
|   ;
|   return 0;
| }

Tags: fromappdevelopersizeincludeusrhavecontents