Skip to content

fix missing gethostbyname_r on Android 5.1 #1581

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

Merged
merged 2 commits into from
Jan 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pythonforandroid/recipes/python2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Python2Recipe(GuestPythonRecipe):
# is_api_lt(21)), # Todo: this should be tested
'patches/fix-missing-extensions.patch',
'patches/fix-filesystem-default-encoding.patch',
'patches/fix-gethostbyaddr.patch',
'patches/fix-posix-declarations.patch',
'patches/fix-pwd-gecos.patch']

Expand Down
12 changes: 12 additions & 0 deletions pythonforandroid/recipes/python2/patches/fix-gethostbyaddr.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- Python-2.7.15/Modules/socketmodule.c.orig 2017-12-29 01:40:09.915694810 +0100
+++ Python-2.7.15/Modules/socketmodule.c 2017-12-29 01:40:36.967694486 +0100
@@ -156,6 +156,9 @@
On the other hand, not all Linux versions agree, so there the settings
computed by the configure script are needed! */

+/* Android hack, same reason are what is described above */
+#undef HAVE_GETHOSTBYNAME_R
+
#ifndef linux
# undef HAVE_GETHOSTBYNAME_R_3_ARG
# undef HAVE_GETHOSTBYNAME_R_5_ARG