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.

classification
Title: Cross-compilation of CPython 3.8 with _socket module using Anddroid NDK fails
Type: compile error Stage: resolved
Components: Cross-Build Versions: Python 3.8
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Alex.Willmer, laheller
Priority: normal Keywords:

Created on 2021-05-27 11:51 by laheller, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg394539 - (view) Author: Ladislav Heller (laheller) Date: 2021-05-27 11:51
Trying to cross-compile CPython 3.8 using Android NDK toolchain with _socket module enabled. Build fails at:

../Modules/socketmodule.c:6739:5: error: invalid use of undefined type 'struct if_nameindex'
     for (i = 0; ni[i].if_index != 0 && i < INT_MAX; i++) {
     ^
../Modules/socketmodule.c:6739:19: error: dereferencing pointer to incomplete type
     for (i = 0; ni[i].if_index != 0 && i < INT_MAX; i++) {
                   ^
../Modules/socketmodule.c:6753:17: error: invalid use of undefined type 'struct if_nameindex'
                 ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name);
                 ^
../Modules/socketmodule.c:6753:19: error: dereferencing pointer to incomplete type
                 ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name);
                   ^
../Modules/socketmodule.c:6753:17: error: invalid use of undefined type 'struct if_nameindex'
                 ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name);
                 ^
../Modules/socketmodule.c:6753:62: error: dereferencing pointer to incomplete type
                 ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name);
                                                              ^

Without _socket module, the cross-compilation works well. Also the result python3 build transferred to my Android device and tested in Terminal app works well. However without _socket module for example the command:
"python3 -m ensurepip"
obviously fails because of missing _socket module.
msg407710 - (view) Author: Ladislav Heller (laheller) Date: 2021-12-05 13:37
Tried to cross-compile with an old version of Android NDK.
Using the latest NDK it works perfectly.
History
Date User Action Args
2022-04-11 14:59:46adminsetgithub: 88411
2021-12-05 13:37:24lahellersetstatus: open -> closed
resolution: not a bug
messages: + msg407710

stage: resolved
2021-05-27 11:51:42lahellercreate