[issue27453] Fix cross-compilation with Android NDK and Clang
Xavier de Gaye
report at bugs.python.org
Tue Jul 5 11:00:49 EDT 2016
Xavier de Gaye added the comment:
With configure run as './configure CC="$(CC)" ...' and when CC is set to:
CC = clang --sysroot=$(SYSROOT) -target $(TARGET) -gcc-toolchain $(GCC_TOOLCHAIN)
and building for armv7 on android-21, then configure runs $CPP as:
checking for CPP... clang --sysroot=/opt/android-ndk/platforms/android-21/arch-arm -target armv7-none-linux-androideabi -gcc-toolchain /opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -E
as can be seen by inserting in configure.ac:
AC_MSG_CHECKING([for CPP])
AC_MSG_RESULT([$CPP])
and the shared libraries are named 'module_name.cpython-36m-arm-linux-gnueabi.so'.
OTOH, the 'configure' script runs its own preprocessings with the following idiom:
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then :
where 'ac_cpp' is set to ac_cpp='$CPP $CPPFLAGS'.
So the proposed patch LGTM.
PLATFORM_TRIPLETs are specific to multiarch systems such as debian and should not be relied upon on Android, but they should not be entirely wrong of course.
----------
nosy: +doko
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27453>
_______________________________________
More information about the Python-bugs-list
mailing list