-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
作者你好,在IOS9.0.2中安装python,运行报错? #3
Comments
diff --git a/build.sh b/build.sh
index b25c269..073bdc8 100755
--- a/build.sh
+++ b/build.sh
@@ -32,7 +32,7 @@ echo "[Script by Linus Yang]"
echo ""
# sdk variable
-export IOS_VERSION="5.1"
+export IOS_VERSION="9.1"
export DEVROOT=$("xcode-select" -print-path)"/Platforms/iPhoneOS.platform/Developer"
export SDKROOT="$DEVROOT/SDKs/iPhoneOS${IOS_VERSION}.sdk"
@@ -69,7 +69,7 @@ fi
# download python
echo '[Fetching Python source code]'
if [[ ! -a Python-${PYVER}.tar.xz ]]; then
- curl -O http://www.python.org/ftp/python/${PYVER}/Python-${PYVER}.tar.xz
+ curl -L -O http://www.python.org/ftp/python/${PYVER}/Python-${PYVER}.tar.xz
fi
# extract dependency library
@@ -79,20 +79,20 @@ tar zxf "${PRELIB}" -C "${PRELIBFIX}"
# get rid of old build
rm -rf Python-${PYVER}
-tar Jxf Python-${PYVER}.tar.xz
+/usr/bin/tar Jxf Python-${PYVER}.tar.xz
pushd ./Python-${PYVER} > /dev/null 2>&1
# build for native machine
echo '[Building for host system]'
SAVESDK="$SDKROOT"
export SDKROOT=""
-./configure > /dev/null 2>&1
-make > /dev/null 2>&1
+./configure
+make
mv python.exe python.exe_for_build
mv Parser/pgen Parser/pgen_for_build
mv build "$PRELIBLOC/build_host"
mv pybuilddir.txt pybuilddir_host.txt
-sed -i '' 's:build/:build_host/:g' pybuilddir_host.txt
+/usr/bin/sed -i '' 's:build/:build_host/:g' pybuilddir_host.txt
make distclean > /dev/null 2>&1
export SDKROOT="$SAVESDK"
@@ -103,7 +103,7 @@ patch -p1 < ../patches/Python-xcompile-${PYVER}.patch
export CPPFLAGS="-I$SDKROOT/usr/include/ -I$PRELIBLOC/usr/include"
export CFLAGS="$CPPFLAGS -pipe -isysroot $SDKROOT"
export CXXFLAGS="$CFLAGS"
-export LDFLAGS="-isysroot $SDKROOT -miphoneos-version-min=3.0 -L$SDKROOT/usr/lib/ -L$PRELIBLOC/usr/lib"
+export LDFLAGS="-isysroot $SDKROOT -miphoneos-version-min=3.0 -L$SDKROOT/usr/lib/ -L$PRELIBLOC/usr/lib -segalign 4000"
export CC="$NATICC"
export CXX="$NATICXX"
export LD="$DEVROOT/usr/bin/ld"
@@ -111,7 +111,7 @@ export OPT="-DNDEBUG -O3 -Wall -Wstrict-prototypes"
# build for iphone
echo '[Cross compiling for Darwin ARM]'
-./configure --prefix=/usr --enable-ipv6 --host=arm-apple-darwin --build=x86_64-apple-darwin --enable-shared --disable-toolbox-glue --with-signal-module --with-system-ffi --without-pymalloc ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no ac_cv_have_long_long_format=yes > /dev/null 2>&1
+./configure --prefix=/usr --enable-ipv6 --host=arm-apple-darwin --build=x86_64-apple-darwin --enable-shared --disable-toolbox-glue --with-signal-module --with-system-ffi --without-pymalloc ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no ac_cv_have_long_long_format=yes
make
mv "$PRELIBLOC/build_host" .
make install prefix="$PWD/_install/usr" > /dev/null 2>&1
@@ -124,7 +124,7 @@ chmod +x "$LDIDLOC"
# symlink binary
cd "${NOWDIR}/Python-${PYVER}/_install/usr/bin"
ln -sf python${PYSHORT} python
-sed -i '' "s:${NOWDIR}/Python-${PYVER}/_install::g" python${PYSHORT}-config
+/usr/bin/sed -i '' "s:${NOWDIR}/Python-${PYVER}/_install::g" python${PYSHORT}-config
cd "${NOWDIR}"
# make debian package Fails at:
不存在 |
I was able to get it running on OS X El Capitan with Xcode 7 & the iOS 9.1 SDK. See https://github.com/jdelman/python-for-ios and checkout branch |
Cool except jdelman@83381dc#diff-46cb3d86e30c6dd7e235dbd05f49b19fR16 . Doesn't this make I do not know if there is a good workaround without using Objective-C at this point. With Objective-C, and telling the compiler to use that language for that file ( NSDictionary *objectiveCEnv = [[NSProcessInfo processInfo] environment];
for (NSString *aKey in objectiveCEnv) {
char *tmp = [[NSString stringWithFormat:@"%@=%@", aKey, objectiveCEnv[aKey]] UTF8String];
// ...
} |
Good point, I hacked it together haphazardly & blindly without realizing I fired it up after that and saw I also couldn't import math, or urllib2 Are you saying you'd replace crt_externs.h with that Obj-C code? On Mon, Nov 16, 2015 at 7:55 PM, Andrew Udvare [email protected]
|
Nah, I think if |
Also with regard to some modules, I do not think all the modules worked in the previous build either. |
@jdelman any news on this? Would love to get python working on iOS 9 |
Mark and wait for ios9 version |
https://www.dropbox.com/s/qp862ppjz3rzi81/Python-2.7.8-arm64.zip?dl=0 Only install python it self may work, but I install all deb package. |
@formoon What model iPhone are you running that on? Is it a 32-bit (iPhone 5 and earlier) or 64-bit (iPhone 5S and later) model? |
64bit iPhone6s. 发自我的 iPhone
|
@formoon I had installed Python 2.7.6 for iOS (build 3),and ldid -S /usr/bin/python2.7,but I still get killed 9 error,ipad air2 (9.3.3) |
I am getting the same error after the same steps on iPhone 6S 9.3.3 |
Building fixed for 9.3 but not everything works. |
@jdelman I forked your repo and can build, however seeing 'No module named select' while trying to import subprocess. Any idea? Seeing logs:
|
There is a ton of stuff to fix to make this work fully again (or usefully). Some of those are not fixable (easily) but most are. They require libraries to be present, some of which don't exist on Cydia. You really should go for modularism here and build those libraries as separate packages for Cydia and then build Python based on those. It will help many projects to have updated libraries. |
I was able to build a version for IOS 9 from jdelman's branch; is that going to be merged into this mainline? also, is anybody actively working these issues that @Tatsh references above? |
...also, this is a link to the DEB file I built and installed on 9.3.3 with the Pangu break: https://drive.google.com/open?id=0B5vZIFDVHQ19d25KY2xlbUdLVzQ Perhaps you guys could make this available as a release, with caveats? |
@cclamb if you made any improvements, please provide a patch or set of patches. |
No, I haven't touched the code yet, but I was able to build the arm64 branch of the repo @jdelman forked; maybe he could submit a pull request? I could not build from master on this repo, which is why I'm asking. I'm happy to pitch in, but I don't see any specific issues in the issue tracker than need to be fixed, though I see a few things alluded to here. Is anybody actively tracking these yet? |
Well, jdelman@83381dc is not exactly the same as my patch. We need to merge these results. And then keep going. Also need to future-proof for iOS 10 in this effort. The code should compile for a non-jailbroken updated iOS 10 device, and still work with iOS 9.3.3, maybe 9.0.2 for those stuck behind. |
Ah, okay. So your patch isn't pushed. Do I just need to apply the patchfile above? |
Compare Tatsh@1525f3d with jdelman@83381dc and see what's new and what's improved in @jdelman's version. He seems to have a new patch there for the Also note full paths (like |
@Tatsh always get error on compile for 64 bit from your repo,
and config.log said : -----------confdefs.h.-----------/* confdefs.h */ configure: exit 77 any suggestion for fix it? i use xCode 8.2.1 |
I don't get that error and the only difference now is this ( diff --git a/build.sh b/build.sh
index 7f91eca..6b3c3c2 100755
--- a/build.sh
+++ b/build.sh
@@ -32,7 +32,7 @@ echo "[Script by Linus Yang]"
echo ""
# sdk variable
-export IOS_VERSION="9.3"
+export IOS_VERSION="10.2"
export DEVROOT=$("xcode-select" -print-path)"/Platforms/iPhoneOS.platform/Developer"
export SDKROOT="$DEVROOT/SDKs/iPhoneOS${IOS_VERSION}.sdk" |
damn... something wrong with my env... 🤔 |
报错信息如下:
dyld: Library not loaded: /usr/lib/libpython2.7.dylib
Referenced from: /usr/bin/python
Reason: no suitable image found. Did find:
/usr/lib/libpython2.7.dylib: mmap() error 22 at address=0x00242000, size=0x0002A000 segment=__DATA in Segment::map() mapping /usr/lib/libpython2.7.dylib
/usr/lib/libpython2.7.dylib: mmap() error 22 at address=0x003D6000, size=0x0002A000 segment=__DATA in Segment::map() mapping /usr/lib/libpython2.7.dylib
Trace/BPT trap: 5
The text was updated successfully, but these errors were encountered: