Skip to content

bpo-36361: Generate correct pyconfig.h when cross-compiling#12429

Closed
xdegaye wants to merge 1 commit into
python:masterfrom
xdegaye:bpo-36361
Closed

bpo-36361: Generate correct pyconfig.h when cross-compiling#12429
xdegaye wants to merge 1 commit into
python:masterfrom
xdegaye:bpo-36361

Conversation

@xdegaye

@xdegaye xdegaye commented Mar 19, 2019

Copy link
Copy Markdown
Contributor

When cross-compiling and the CONFIG_SITE environment variable is unset or empty, configure copies the executables, results of the build of the AC_RUN_IFELSE test programs in configure.ac, to the build/run_ifelse_cvs directory.

The Misc/build_config_site.sh script may be run then to create a config.site file when invoked with one of the parameters as a path to a shell script that transfers an executable to the platform, target of the cross-compilation, and runs it on this platform.

A second run of 'configure' with the CONFIG_SITE environment variable set to the absolute path of this config.site file allows configuring the Python build with the correct cache values for this platform.

https://bugs.python.org/issue36361

@xdegaye

xdegaye commented Mar 19, 2019

Copy link
Copy Markdown
Contributor Author

For example, on Android arm64 at API 24, the config.site file is:

# This script has been generated by build_config_site.sh from the following
# list of cache values handled by AC_RUN_IFELSE macros as found
# in configure.ac:
#
#    ac_cv_aligned_required
#    ac_cv_broken_mbstowcs
#    ac_cv_broken_nice
#    ac_cv_broken_poll
#    ac_cv_broken_sem_getvalue
#    ac_cv_buggy_getaddrinfo
#    ac_cv_c_bigendian
#    ac_cv_computed_gotos
#    ac_cv_have_chflags
#    ac_cv_have_lchflags
#    ac_cv_have_size_t_format
#    ac_cv_kpthread
#    ac_cv_kthread
#    ac_cv_posix_semaphores_enabled
#    ac_cv_pthread
#    ac_cv_pthread_is_default
#    ac_cv_pthread_system_supported
#    ac_cv_rshift_extends_sign
#    ac_cv_wchar_t_signed
#    ac_cv_working_tzset
#    ac_cv_x87_double_rounding
#    have_glibc_memmove_bug
#
# The list may be used to verify that this config.site file has not become
# stale in the case of addition of new cache values in configure.ac.
#
# The script sets the following cache values that have been found different
# from the pessimistic default values set by AC_RUN_IFELSE, after running the
# executable on the target machine:


  ac_cv_pthread_is_default=yes
  ac_cv_kthread=no
  ac_cv_pthread=no

ac_cv_aligned_required=no
ac_cv_pthread_system_supported=yes
ac_cv_have_chflags=no
ac_cv_have_lchflags=no
ac_cv_buggy_getaddrinfo=no
ac_cv_posix_semaphores_enabled=no
ac_cv_wchar_t_signed=no
ac_cv_c_bigendian=no
ac_cv_working_tzset=yes
ac_cv_have_size_t_format=yes
ac_cv_computed_gotos=yes
have_glibc_memmove_bug=no

@xdegaye

xdegaye commented Mar 19, 2019

Copy link
Copy Markdown
Contributor Author

The helper script used by Misc/build_config_site.sh to create the above config.site file for Android running on an emulator or a device, is:

#! /bin/sh
#
#   usage: adb_push_exec.sh /path/to/executable
#
# Use adb to push an executable on an Android emulator or device and
# to run the executable.

# The name of the executable using variable substitution instead of basename.
executable=${1##*/}

adb=$ANDROID_SDK_ROOT/platform-tools/adb
tmpdir=/data/local/tmp

$adb push $1 $tmpdir >/dev/null 2>&1
$adb shell $tmpdir/$executable
status=$?
$adb shell rm $tmpdir/$executable
exit $status

@xdegaye xdegaye closed this Dec 10, 2019
@xdegaye
xdegaye deleted the bpo-36361 branch December 10, 2019 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants