This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2016年10月26日 09:38 by xdegaye, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| if_nameindex.patch | xdegaye, 2016年11月08日 19:35 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 552 | closed | dstufft, 2017年03月31日 16:36 | |
| PR 4479 | merged | xdegaye, 2017年11月20日 19:52 | |
| Messages (7) | |||
|---|---|---|---|
| msg279495 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年10月26日 09:38 | |
On the latest Android API level (android-24), the if_nameindex function is now found by configure in Android libc. But the if_nameindex function and structure are still not defined in the Android net/if.h header.
The compilation fails with:
clang --sysroot=/opt/android-ndk/platforms/android-24/arch-x86 -target i686-none-linux-androideabi -gcc-toolchain /opt/android-ndk/toolchains/x86-4.9/prebuilt/linux-x86_64 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Wno-unused-value -Wno-empty-body -Qunused-arguments -Wno-parentheses-equality -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -IObjects -IInclude -IPython -I/home/xavier/src/android/pyona/build/python3.7-install-android-24-x86/org.bitbucket.pyona/include -I/opt/android-ndk/platforms/android-24/arch-x86/usr/include -I/path/to/android/cpython/Include -I/home/xavier/src/android/pyona/build/python3.7-android-24-x86 -c /path/to/android/cpython/Modules/socketmodule.c -o build/temp.linux-i686-3.7/path/to/android/cpython/Modules/socketmodule.o
/path/to/android/cpython/Modules/socketmodule.c:1034:29: warning: comparison of integers of different signs: 'socklen_t' (aka 'int') and 'size_t' (aka 'unsigned int') [-Wsign-compare]
if (res->ai_addrlen < addr_ret_size)
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
/path/to/android/cpython/Modules/socketmodule.c:1125:25: warning: comparison of integers of different signs: 'socklen_t' (aka 'int') and 'size_t' (aka 'unsigned int') [-Wsign-compare]
if (res->ai_addrlen < addr_ret_size)
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
/path/to/android/cpython/Modules/socketmodule.c:4925:15: warning: implicit declaration of function 'sethostname' is invalid in C99 [-Wimplicit-function-declaration]
res = sethostname(buf.buf, buf.len);
^
/path/to/android/cpython/Modules/socketmodule.c:6242:10: warning: implicit declaration of function 'if_nameindex' is invalid in C99 [-Wimplicit-function-declaration]
ni = if_nameindex();
^
/path/to/android/cpython/Modules/socketmodule.c:6242:8: warning: incompatible integer to pointer conversion assigning to 'struct if_nameindex *' from 'int' [-Wint-conversion]
ni = if_nameindex();
^ ~~~~~~~~~~~~~~
/path/to/android/cpython/Modules/socketmodule.c:6250:9: warning: implicit declaration of function 'if_freenameindex' is invalid in C99 [-Wimplicit-function-declaration]
if_freenameindex(ni);
^
/path/to/android/cpython/Modules/socketmodule.c:6254:19: error: subscript of pointer to incomplete type 'struct if_nameindex'
for (i = 0; ni[i].if_index != 0 && i < INT_MAX; i++) {
~~^
/path/to/android/cpython/Modules/socketmodule.c:6240:12: note: forward declaration of 'struct if_nameindex'
struct if_nameindex *ni;
^
/path/to/android/cpython/Modules/socketmodule.c:6256:19: error: subscript of pointer to incomplete type 'struct if_nameindex'
ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name);
~~^
/path/to/android/cpython/Modules/socketmodule.c:6240:12: note: forward declaration of 'struct if_nameindex'
struct if_nameindex *ni;
^
/path/to/android/cpython/Modules/socketmodule.c:6256:62: error: subscript of pointer to incomplete type 'struct if_nameindex'
ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name);
~~^
/path/to/android/cpython/Modules/socketmodule.c:6240:12: note: forward declaration of 'struct if_nameindex'
struct if_nameindex *ni;
^
6 warnings and 3 errors generated.
|
|||
| msg280340 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年11月08日 19:35 | |
Patch attached. |
|||
| msg283745 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年12月21日 11:49 | |
New changeset e248bfb0f520 by Xavier de Gaye in branch '3.6': Issue #28538: Fix the compilation error that occurs because if_nameindex() is https://hg.python.org/cpython/rev/e248bfb0f520 New changeset 55bf0b79ec55 by Xavier de Gaye in branch 'default': Issue #28538: Merge 3.6. https://hg.python.org/cpython/rev/55bf0b79ec55 |
|||
| msg283765 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年12月21日 16:23 | |
These changes break the darwin platform, socket.if_nameindex() is not defined anymore. On Darwin, 'net/if.h' requires that 'sys/socket.h' be included beforehand (see the autoconf documentation). |
|||
| msg283768 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年12月21日 16:31 | |
New changeset f34dac552ad8 by Xavier de Gaye in branch '3.6': Issue #28538: On Darwin net/if.h requires that sys/socket.h be included beforehand. https://hg.python.org/cpython/rev/f34dac552ad8 New changeset c568b6ac5e89 by Xavier de Gaye in branch 'default': Issue #28538: Merge 3.6. https://hg.python.org/cpython/rev/c568b6ac5e89 |
|||
| msg306579 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2017年11月20日 19:55 | |
These changes are not needed anymore now that Unified Headers are supported by android-ndk-r14 (see issue 29040) |
|||
| msg306797 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2017年11月23日 10:13 | |
New changeset 5ad7ef8e420de8a54fb30ed37362194c6b96012c by xdegaye in branch 'master': bpo-28538: Revert all the changes (now using Android Unified Headers) (GH-4479) https://github.com/python/cpython/commit/5ad7ef8e420de8a54fb30ed37362194c6b96012c |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:38 | admin | set | github: 72724 |
| 2017年11月23日 10:15:27 | xdegaye | set | status: open -> closed resolution: not a bug -> fixed stage: patch review -> resolved |
| 2017年11月23日 10:13:25 | xdegaye | set | messages: + msg306797 |
| 2017年11月20日 19:55:56 | xdegaye | set | status: closed -> open resolution: fixed -> not a bug messages: + msg306579 stage: resolved -> patch review |
| 2017年11月20日 19:52:33 | xdegaye | set | pull_requests: + pull_request4416 |
| 2017年03月31日 16:36:11 | dstufft | set | pull_requests: + pull_request872 |
| 2016年12月21日 19:50:49 | xdegaye | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2016年12月21日 16:31:37 | python-dev | set | messages: + msg283768 |
| 2016年12月21日 16:23:19 | xdegaye | set | messages: + msg283765 |
| 2016年12月21日 11:49:00 | python-dev | set | nosy:
+ python-dev messages: + msg283745 |
| 2016年11月08日 19:35:53 | xdegaye | set | files:
+ if_nameindex.patch components: + Cross-Build keywords: + patch nosy: + Alex.Willmer, doko messages: + msg280340 stage: needs patch -> patch review |
| 2016年10月26日 09:40:53 | xdegaye | link | issue26865 dependencies |
| 2016年10月26日 09:38:53 | xdegaye | create | |