2017-05-24 20 views
1

我有一個依賴於Python2.7的bitbake配方。是否可以在CPython中禁用_FILE_OFFSET_BITS == 64(作爲Yocto/Poky包)?

我試圖編譯一個包含Python.h和包含fts.h的庫頭文件(由CFFI生成)的C文件。它失敗

#error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"

我注意到_FILE_OFFSET_BITS設置爲64pyconfig.h:1136,並自動生成該文件,所以我不知道我是否可以防止這種#define被包括在內,在沒有成本能夠訪問大於2GB的文件。

爲了記錄在案,被包括通過

RDEPENDS_${PN} += "python"

文件

/common/recipes-core/packagegroups/nativesdk-packagegroup-swi-toolchain.bb

回答

2

哦,結束了是相當簡單的Python!

文件/禁用-lfs.patch

--- Python-2.7.3.orig/configure.in 
+++ Python-2.7.3/configure.in 
@@ -1449,7 +1449,7 @@ 
# structures (such as rlimit64) without declaring them. As a 
# work-around, disable LFS on such configurations 

-use_lfs=yes 
+use_lfs=no 
AC_MSG_CHECKING(Solaris LFS bug) 
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 
#define _LARGEFILE_SOURCE 1 

蟒蛇本地_%。bbappend

FILESEXTRAPATHS_prepend := "${THISDIR}/files:" 
SRC_URI += "file://disable-lfs.patch" 
+0

我申請上configure.ac修復您的Python-3.6.2,並調用autoconf的。感謝您發佈解決方案。 – Nelstaar

相關問題