New submission from Xavier de Gaye <xdeg...@gmail.com>:

When cross-compiling, the gcc and clang `--sysroot=` compiler option may be 
used to change the logical path of the system headers and libraries to a path 
located within the install path of the cross-compiler tool chain.

Android is a special case:
--------------------------
With Unified Headers [1], the most recent versions of the Android NDK add an 
additional constraint: the root paths of usr/include and usr/lib are distinct. 
For example when cross-compiling for API 24 and the x86_64 architecture the 
full paths are:
* headers:   ANDROID_NDK_ROOT/sysroot/usr/include
* libraries: ANDROID_NDK_ROOT/platforms/android-24/arch-x86_64/usr/lib64

To use sysroot in this example one needs to set sysroot to 
ANDROID_NDK_ROOT/sysroot in CFLAGS or CPPFLAGS and to set sysroot to 
ANDROID_NDK_ROOT/platforms/android-24/arch-x86_64 in LDFLAGS, while on a 
standard platform where the root path of usr/include and usr/lib is common, one 
would only need to set sysroot to this root path in CFLAGS.

[1] 
https://android.googlesource.com/platform/ndk.git/+/master/docs/UnifiedHeaders.md

----------
components: Cross-Build
messages: 306432
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
stage: needs patch
status: open
title: detect_modules() in setup.py must also search the sysroot paths
type: behavior
versions: Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32059>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to