Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix libffi recipe, and build + runtime linker errors when compiling on WSL #1744

Merged
merged 8 commits into from
Mar 20, 2019

Conversation

Aralox
Copy link
Contributor

@Aralox Aralox commented Mar 8, 2019

Force the use of lld (LLVM's linker), and include a python37 bugfix.
https://clang.llvm.org/docs/Toolchain.html
https://lld.llvm.org/
https://bz-attachments.freebsd.org/attachment.cgi?id=200526

I use p4a in windows bash (windows subsystem for linux). Upgrading from the stable version 0.7.0 to the develop version 0.7.1 causes linker errors when building libffi:

/other_builds/libffi/x86__ndk_target_21/libffi/.libs/libffi.so: error: undefined reference to 'ffi_prep_cif_machdep'
/other_builds/libffi/x86__ndk_target_21/libffi/.libs/libffi.so: error: undefined reference to 'ffi_prep_closure_loc'
/other_builds/libffi/x86__ndk_target_21/libffi/.libs/libffi.so: error: undefined reference to 'ffi_prep_raw_closure_loc'
/other_builds/libffi/x86__ndk_target_21/libffi/.libs/libffi.so: error: undefined reference to 'ffi_prep_cif_machdep'
/other_builds/libffi/x86__ndk_target_21/libffi/.libs/libffi.so: error: undefined reference to 'ffi_prep_closure_loc'
/other_builds/libffi/x86__ndk_target_21/libffi/.libs/libffi.so: error: undefined reference to 'ffi_prep_raw_closure_loc'

This is partially due the fact that we now use clang to compile libffi instead of gcc. I fixed the problem by forcing the clang invocation to use lld, which is llvm's linker fixing the libffi recipe, by adding an equals sign = between the --sysroot flag and value in LDFLAGS (see commit messages). If this PR is merged, lld will now be a requirement to use p4a. I think this is fine since we are using clang anyway (and it is awesome).

EDIT: lld is now not required, libffi builds successfully with regular ld now, but I have left in my deltas which change the linker to lld, as I feel like it should be the way forward. Let me know what you think.

The -L. flag is just me incorporating the fix of a bug in python37, as linked above.

I've updated the dockerfile for python 3 to include an lld install, but please let me know if I should update any documentation etc to indicate that lld is required. Thanks!

@Aralox Aralox changed the title Fix libffi linker errors when compiling on WSL Fix libffi recipe, and build + runtime linker errors when compiling on WSL Mar 12, 2019
@robertpro
Copy link

Hi @Aralox , I tried your branch, but I see this error:

Fedora 29
Python 3.7

buildozer android debug run deploy

(test_drawer) [roberto@roberto test_drawer]$ buildozer android debug run deploy
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
/bin/sh: dpkg: command not found
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /home/roberto/.virtualenvs/test_drawer/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.fc29.x86_64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.fc29.x86_64/jre/bin/keytool
# Install platform
# Run '/home/roberto/.virtualenvs/test_drawer/bin/python -m pip install -q  \'appdirs\' \'colorama>=0.3.3\' \'jinja2\' \'six\' \'enum34; python_version<"3.4"\' \'sh>=1.10; sys_platform!="nt"\''
# Cwd None
# Apache ANT found at /home/roberto/dev/tools/android/ant
# Android SDK found at /home/roberto/dev/tools/android/sdk
# Android NDK found at /home/roberto/dev/tools/android/ndk
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/home/roberto/.virtualenvs/test_drawer/bin/python -m pythonforandroid.toolchain create --dist_name=test_drawer --bootstrap=sdl2 --requirements=python3,kivy,plyer --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/roberto/dev/tools/android/buildozer/android/platform/build" --ndk-api=21'
# Cwd /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
/home/roberto/dev/tools/android/buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py:83: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI: 27
[INFO]:    Available Android APIs are (10, 14, 16, 19, 26, 27, 28)
[INFO]:    Requested API target 27 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK: /home/roberto/dev/tools/android/ndk
[INFO]:    Found NDK revision 17.2.4988734
[INFO]:    Getting NDK API version (i.e. minimum supported API) from user argument
[INFO]:    Found virtualenv at /home/roberto/.virtualenvs/test_drawer/bin/virtualenv
[INFO]:    Found the following toolchain versions: ['4.9']
[INFO]:    Picking the latest gcc toolchain, here 4.9
[INFO]:    No existing dists meet the given requirements!
[INFO]:    No dist exists that meets your requirements, so one will be built.
[INFO]:    Found a single valid recipe set: ['hostpython3', 'libffi', 'openssl', 'plyer', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'six', 'pyjnius', 'android', 'kivy']
[INFO]:    The selected bootstrap is sdl2
[INFO]:    # Creating dist with sdl2 bootstrap
[INFO]:    Dist will have name test_drawer and requirements (python3, kivy, plyer)
[INFO]:    Dist contains the following requirements as recipes: ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'six', 'pyjnius', 'android', 'kivy']
[INFO]:    Dist will also contain modules (plyer) installed from pip
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Recipe build order is ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'six', 'pyjnius', 'android', 'kivy']
[INFO]:    The requirements (plyer) were not found as recipes, they will be installed with pip.
[INFO]:    # Downloading recipes 
[INFO]:    Downloading hostpython3
[INFO]:    -> running mkdir -p /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/hostpython3
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/hostpython3
[INFO]:    -> running basename https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
[INFO]:    hostpython3 download already cached, skipping                                                                                                                                 
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Downloading libffi
[INFO]:    -> running mkdir -p /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/libffi
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/libffi
[INFO]:    -> running basename https://github.com/libffi/libffi/archive/v3.2.1.tar.gz
[INFO]:    libffi download already cached, skipping                                                                                                                                      
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Downloading openssl
[INFO]:    -> running mkdir -p /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/openssl
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/openssl
[INFO]:    -> running basename https://www.openssl.org/source/openssl-1.1.1.tar.gz
[INFO]:    openssl download already cached, skipping                                                                                                                                     
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Downloading sdl2_image
[INFO]:    -> running mkdir -p /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/sdl2_image
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/sdl2_image
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.4.tar.gz
[INFO]:    sdl2_image download already cached, skipping                                                                                                                                  
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Downloading sdl2_mixer
[INFO]:    -> running mkdir -p /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/sdl2_mixer
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/sdl2_mixer
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
[INFO]:    sdl2_mixer download already cached, skipping                                                                                                                                  
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Downloading sdl2_ttf
[INFO]:    -> running mkdir -p /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/sdl2_ttf
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/sdl2_ttf
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
[INFO]:    sdl2_ttf download already cached, skipping                                                                                                                                    
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Downloading sqlite3
[INFO]:    -> running mkdir -p /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/sqlite3
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/sqlite3
[INFO]:    -> running basename https://www.sqlite.org/2016/sqlite-amalgamation-3150100.zip
[INFO]:    sqlite3 download already cached, skipping                                                                                                                                     
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Downloading python3
[INFO]:    -> running mkdir -p /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/python3
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/python3
[INFO]:    -> running basename https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
[INFO]:    python3 download already cached, skipping                                                                                                                                     
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Downloading sdl2
[INFO]:    -> running mkdir -p /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/sdl2
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/sdl2
[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
[INFO]:    sdl2 download already cached, skipping                                                                                                                                        
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Downloading six
[INFO]:    -> running mkdir -p /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/six
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/six
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
[INFO]:    six download already cached, skipping                                                                                                                                         
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Downloading pyjnius
[INFO]:    -> running mkdir -p /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/pyjnius
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/pyjnius
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/6553ad4.zip
[INFO]:    pyjnius download already cached, skipping                                                                                                                                     
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Downloading android
[INFO]:    Skipping android download as no URL is set
[INFO]:    Downloading kivy
[INFO]:    -> running mkdir -p /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/kivy
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/packages/kivy
[INFO]:    -> running basename https://github.com/kivy/kivy/archive/a95d67f.zip
[INFO]:    kivy download already cached, skipping                                                                                                                                        
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    # Building all recipes for arch armeabi-v7a
[INFO]:    # Unpacking recipes
[INFO]:    Unpacking hostpython3 for armeabi-v7a
[INFO]:    -> running basename https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/hostpython3/desktop                                                  
[INFO]:    hostpython3 is already unpacked, skipping
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Unpacking libffi for armeabi-v7a
[INFO]:    -> running basename https://github.com/libffi/libffi/archive/v3.2.1.tar.gz
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21                                    
[INFO]:    libffi is already unpacked, skipping
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Unpacking openssl for armeabi-v7a
[INFO]:    -> running basename https://www.openssl.org/source/openssl-1.1.1.tar.gz
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21                                   
[INFO]:    openssl is already unpacked, skipping
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Unpacking sdl2_image for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.4.tar.gz
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni                                                 
[INFO]:    sdl2_image is already unpacked, skipping
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Unpacking sdl2_mixer for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni                                                 
[INFO]:    sdl2_mixer is already unpacked, skipping
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Unpacking sdl2_ttf for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni                                                 
[INFO]:    sdl2_ttf is already unpacked, skipping
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Unpacking sqlite3 for armeabi-v7a
[INFO]:    -> running basename https://www.sqlite.org/2016/sqlite-amalgamation-3150100.zip
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21                                   
[INFO]:    sqlite3 is already unpacked, skipping
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Unpacking python3 for armeabi-v7a
[INFO]:    -> running basename https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21            
[INFO]:    python3 is already unpacked, skipping
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Unpacking sdl2 for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni                                                 
[INFO]:    sdl2 is already unpacked, skipping
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Unpacking six for armeabi-v7a
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/six-python3/armeabi-v7a__ndk_target_21                               
[INFO]:    six is already unpacked, skipping
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Unpacking pyjnius for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/6553ad4.zip
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21                      
[INFO]:    pyjnius is already unpacked, skipping
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    -> running rm -rf /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/android-python3-sdl2/armeabi-v7a__ndk_target_21/android
[INFO]:    -> running cp -a /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android/pythonforandroid/recipes/android/src /home/roberto/d...(and 124 more)
[INFO]:    Unpacking kivy for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/kivy/archive/a95d67f.zip
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/kivy-python3-sdl2/armeabi-v7a__ndk_target_21                         
[INFO]:    kivy is already unpacked, skipping
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    # Prebuilding recipes
[INFO]:    Prebuilding hostpython3 for armeabi-v7a
[INFO]:    hostpython3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding libffi for armeabi-v7a
[INFO]:    libffi has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for libffi[armeabi-v7a]
[INFO]:    libffi already patched, skipping
[INFO]:    Prebuilding openssl for armeabi-v7a
[INFO]:    openssl has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding sdl2_image for armeabi-v7a
[INFO]:    sdl2_image has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2_image[armeabi-v7a]
[INFO]:    sdl2_image already patched, skipping
[INFO]:    Prebuilding sdl2_mixer for armeabi-v7a
[INFO]:    sdl2_mixer has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2_mixer[armeabi-v7a]
[INFO]:    sdl2_mixer already patched, skipping
[INFO]:    Prebuilding sdl2_ttf for armeabi-v7a
[INFO]:    sdl2_ttf has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding sqlite3 for armeabi-v7a
[INFO]:    sqlite3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding python3 for armeabi-v7a
[INFO]:    python3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for python3[armeabi-v7a]
[INFO]:    python3 already patched, skipping
[INFO]:    Prebuilding sdl2 for armeabi-v7a
[INFO]:    sdl2 has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding six for armeabi-v7a
[INFO]:    six has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding pyjnius for armeabi-v7a
[INFO]:    pyjnius has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for pyjnius[armeabi-v7a]
[INFO]:    pyjnius already patched, skipping
[INFO]:    Prebuilding android for armeabi-v7a
[INFO]:    android has no prebuild_armeabi_v7a, skipping
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/android-python3-sdl2/armeabi-v7a__ndk_target_21/android
[INFO]:    <- directory context /home/roberto/dev/tools/android/buildozer/android/platform/python-for-android
[INFO]:    Prebuilding kivy for armeabi-v7a
[INFO]:    kivy has no prebuild_armeabi_v7a, skipping
[INFO]:    # Building recipes
[INFO]:    Building hostpython3 for armeabi-v7a
[INFO]:    Skipping hostpython3 (3.7.1) build, as it has already been completed
[INFO]:    Building libffi for armeabi-v7a
[INFO]:    libffi said it is already built, skipping
[INFO]:    Building openssl for armeabi-v7a
[INFO]:    openssl said it is already built, skipping
[INFO]:    Building sdl2_image for armeabi-v7a
[INFO]:    Building sdl2_mixer for armeabi-v7a
[INFO]:    Building sdl2_ttf for armeabi-v7a
[INFO]:    Building sqlite3 for armeabi-v7a
[INFO]:    sqlite3 said it is already built, skipping
[INFO]:    Building python3 for armeabi-v7a
[INFO]:    -> directory context /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/android-build
[WARNING]: Doing some hacky stuff to link properly
[INFO]:    -> running cp /home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm/usr/lib/crtbegin_so.o ./
[INFO]:    -> running cp /home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm/usr/lib/crtend_so.o ./
[INFO]:    Activating flags for sqlite3
[INFO]:    Activating flags for libffi
[INFO]:    Activating flags for openssl
[INFO]:    -> running configure --host=arm-linux-androideabi --build=x86_64-pc-linux-gnu --enable-shared --disable-ipv6 ac_cv_file__dev_ptmx=yes ac_cv_file__d...(and 250 more)
Exception in thread background thread for pid 22821:                                                                                                                                     
Traceback (most recent call last):
  File "/usr/lib64/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib64/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/home/roberto/.virtualenvs/test_drawer/lib64/python3.7/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/roberto/.virtualenvs/test_drawer/lib64/python3.7/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/home/roberto/.virtualenvs/test_drawer/lib64/python3.7/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/roberto/.virtualenvs/test_drawer/lib64/python3.7/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_77: 

  RAN: /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/configure --host=arm-linux-androideabi --build=x86_64-pc-linux-gnu --enable-shared --disable-ipv6 ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no --without-ensurepip ac_cv_little_endian_double=yes --prefix=/usr/local --exec-prefix=/usr/local --with-openssl=/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1

  STDOUT:
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking for python3.7... python3.7
checking for python interpreter for cross build... python3.7
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for arm-linux-androideabi-gcc... /home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
checking whether the C compiler works... no
configure: error: in `/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/android-build':
configure: error: C compiler cannot create executables
See `config.log' for more details


  STDERR:


Traceback (most recent call last):
  File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/roberto/dev/tools/android/buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1081, in <module>
    main()
  File "/home/roberto/dev/tools/android/buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1075, in main
    ToolchainCL()
  File "/home/roberto/dev/tools/android/buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 577, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/roberto/dev/tools/android/buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 151, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/roberto/dev/tools/android/buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 200, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "/home/roberto/dev/tools/android/buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 562, in build_recipes
    recipe.build_arch(arch)
  File "/home/roberto/dev/tools/android/buildozer/android/platform/python-for-android/pythonforandroid/python.py", line 249, in build_arch
    _env=env)
  File "/home/roberto/dev/tools/android/buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 178, in shprint
    for line in output:
  File "/home/roberto/.virtualenvs/test_drawer/lib64/python3.7/site-packages/sh.py", line 863, in next
    self.wait()
  File "/home/roberto/.virtualenvs/test_drawer/lib64/python3.7/site-packages/sh.py", line 792, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/roberto/.virtualenvs/test_drawer/lib64/python3.7/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_77: 

  RAN: /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/configure --host=arm-linux-androideabi --build=x86_64-pc-linux-gnu --enable-shared --disable-ipv6 ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no --without-ensurepip ac_cv_little_endian_double=yes --prefix=/usr/local --exec-prefix=/usr/local --with-openssl=/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1

  STDOUT:
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking for python3.7... python3.7
checking for python interpreter for cross build... python3.7
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for arm-linux-androideabi-gcc... /home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
checking whether the C compiler works... no
configure: error: in `/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/android-build':
configure: error: C compiler cannot create executables
See `config.log' for more details


  STDERR:

# Command failed: /home/roberto/.virtualenvs/test_drawer/bin/python -m pythonforandroid.toolchain create --dist_name=test_drawer --bootstrap=sdl2 --requirements=python3,kivy,plyer --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/roberto/dev/tools/android/buildozer/android/platform/build" --ndk-api=21
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

config.log

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by python configure 3.7, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/configure --host=arm-linux-androideabi --build=x86_64-pc-linux-gnu --enable-shared --disable-ipv6 ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no --without-ensurepip ac_cv_little_endian_double=yes --prefix=/usr/local --exec-prefix=/usr/local --with-openssl=/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1

## --------- ##
## Platform. ##
## --------- ##

hostname = roberto
uname -m = x86_64
uname -r = 4.20.14-200.fc29.x86_64
uname -s = Linux
uname -v = #1 SMP Tue Mar 5 19:55:32 UTC 2019

/usr/bin/uname -p = x86_64
/bin/uname -X     = unknown

/bin/arch              = x86_64
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/native-build
PATH: /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86/bin/
PATH: /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/
PATH: /home/roberto/dev/tools/android/ndk
PATH: /home/roberto/dev/tools/android/sdk/tools
PATH: /home/roberto/dev/tools/android/ant/bin
PATH: /home/roberto/.virtualenvs/test_drawer/bin
PATH: /home/roberto/.poetry/bin
PATH: /home/roberto/.pyenv/plugins/pyenv-virtualenv/shims
PATH: /home/roberto/.pyenv/shims
PATH: /home/roberto/dev/tools/npm_packages/bin
PATH: /home/roberto/.pyenv/bin
PATH: /home/roberto/.local/bin
PATH: /home/roberto/bin
PATH: /home/roberto/.poetry/bin
PATH: /home/roberto/.pyenv/plugins/pyenv-virtualenv/shims
PATH: /home/roberto/.poetry/bin
PATH: /home/roberto/.pyenv/plugins/pyenv-virtualenv/shims
PATH: /home/roberto/.pyenv/shims
PATH: /home/roberto/dev/tools/npm_packages/bin
PATH: /home/roberto/.pyenv/bin
PATH: /home/roberto/.local/bin
PATH: /home/roberto/bin
PATH: /usr/lib64/qt-3.3/bin
PATH: /usr/share/Modules/bin
PATH: /usr/lib64/ccache
PATH: /usr/local/bin
PATH: /usr/local/sbin
PATH: /usr/bin
PATH: /usr/sbin
PATH: /var/lib/snapd/snap/bin
PATH: /home/roberto/dev/tools/dart-sdk/sdk/bin/
PATH: /home/roberto/dev/tools/flutter/bin/
PATH: /home/roberto/dev/tools/dart-sdk/sdk/bin/
PATH: /home/roberto/dev/tools/flutter/bin/


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2798: checking build system type
configure:2812: result: x86_64-pc-linux-gnu
configure:2832: checking host system type
configure:2845: result: arm-unknown-linux-androideabi
configure:2875: checking for python3.7
configure:2891: found /usr/bin/python3.7
configure:2902: result: python3.7
configure:2917: checking for python interpreter for cross build
configure:2930: result: python3.7
configure:2996: checking for --enable-universalsdk
configure:3043: result: no
configure:3066: checking for --with-universal-archs
configure:3081: result: no
configure:3237: checking MACHDEP
configure:3443: checking for --without-gcc
configure:3466: result: no
configure:3469: checking for --with-icc
configure:3489: result: no
configure:3573: checking for arm-linux-androideabi-gcc
configure:3600: result: /home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
configure:3869: checking for C compiler version
configure:3878: /home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --version >&5
Android (4691093 based on r316199) clang version 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55536e7d904e0abae47888fc7f) (https://android.googlesource.com/toolchain/llvm 34361f192e41ed6e4e8f9aca80a4ea7e9856f327) (based on LLVM 6.0.2svn)
Target: armv7a-none-linux-android
Thread model: posix
InstalledDir: /home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin
configure:3889: $? = 0
configure:3878: /home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -v >&5
Android (4691093 based on r316199) clang version 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55536e7d904e0abae47888fc7f) (https://android.googlesource.com/toolchain/llvm 34361f192e41ed6e4e8f9aca80a4ea7e9856f327) (based on LLVM 6.0.2svn)
Target: armv7a-none-linux-android
Thread model: posix
InstalledDir: /home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin
Found candidate GCC installation: /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x
Selected GCC installation: /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x
Candidate multilib: thumb;@mthumb
Candidate multilib: armv7-a;@march=armv7-a
Candidate multilib: armv7-a/thumb;@march=armv7-a@mthumb
Candidate multilib: .;
... rest of stderr output deleted ...
configure:3889: $? = 0
configure:3878: /home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:3889: $? = 1
configure:3878: /home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -qversion >&5
clang: error: unknown argument: '-qversion'
clang: error: no input files
configure:3889: $? = 1
configure:3909: checking whether the C compiler works
configure:3931: /home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64  -fPIC --sysroot=/home/roberto/dev/tools/android/ndk/sysroot -D__ANDROID_API__=21 -isystem /home/roberto/dev/tools/android/ndk/sysroot/usr/include/arm-linux-androideabi -I/home/roberto/dev/tools/android/ndk/sysroot/usr/include  -fPIC --sysroot=/home/roberto/dev/tools/android/ndk/sysroot -D__ANDROID_API__=21 -isystem /home/roberto/dev/tools/android/ndk/sysroot/usr/include/arm-linux-androideabi -I/home/roberto/dev/tools/android/ndk/sysroot/usr/include -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3 -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include/internal -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include/openssl  --sysroot=/home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm -L/home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm/usr/lib -L/home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm/usr/lib -L/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3/obj/local/armeabi-v7a -L/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/.libs -L. -fuse-ld=lld -L/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1 conftest.c  -lsqlite3 -lffi -lcrypto1.1 -lssl1.1 >&5
clang: error: invalid linker name in argument '-fuse-ld=lld'
configure:3935: $? = 1
configure:3973: result: no
configure: failed program was:
| /* confdefs.h */
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _DARWIN_C_SOURCE 1
| #define _PYTHONFRAMEWORK ""
| #define _XOPEN_SOURCE 700
| #define _XOPEN_SOURCE_EXTENDED 1
| #define _POSIX_C_SOURCE 200809L
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3978: error: in `/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/android-build':
configure:3980: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_env_CC_set=set
ac_cv_env_CC_value='/home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64'
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=' -fPIC --sysroot=/home/roberto/dev/tools/android/ndk/sysroot -D__ANDROID_API__=21 -isystem /home/roberto/dev/tools/android/ndk/sysroot/usr/include/arm-linux-androideabi -I/home/roberto/dev/tools/android/ndk/sysroot/usr/include'
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=' -fPIC --sysroot=/home/roberto/dev/tools/android/ndk/sysroot -D__ANDROID_API__=21 -isystem /home/roberto/dev/tools/android/ndk/sysroot/usr/include/arm-linux-androideabi -I/home/roberto/dev/tools/android/ndk/sysroot/usr/include -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3 -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include/internal -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include/openssl'
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=' --sysroot=/home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm -L/home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm/usr/lib -L/home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm/usr/lib -L/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3/obj/local/armeabi-v7a -L/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/.libs -L. -fuse-ld=lld -L/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1'
ac_cv_env_LIBS_set=set
ac_cv_env_LIBS_value=' -lsqlite3 -lffi -lcrypto1.1 -lssl1.1'
ac_cv_env_MACHDEP_set=
ac_cv_env_MACHDEP_value=
ac_cv_env_PKG_CONFIG_LIBDIR_set=
ac_cv_env_PKG_CONFIG_LIBDIR_value=
ac_cv_env_PKG_CONFIG_PATH_set=set
ac_cv_env_PKG_CONFIG_PATH_value=/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi
ac_cv_env_PKG_CONFIG_set=
ac_cv_env_PKG_CONFIG_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=x86_64-pc-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=arm-linux-androideabi
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_file__dev_ptc=no
ac_cv_file__dev_ptmx=yes
ac_cv_host=arm-unknown-linux-androideabi
ac_cv_little_endian_double=yes
ac_cv_prog_CC='/home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64'
ac_cv_prog_PYTHON_FOR_REGEN=python3.7

## ----------------- ##
## Output variables. ##
## ----------------- ##

ABIFLAGS=''
AR='/home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar'
ARCH_RUN_32BIT=''
ARFLAGS=''
BASECFLAGS=''
BASECPPFLAGS='-IObjects -IInclude -IPython'
BLDLIBRARY=''
BLDSHARED=''
BUILDEXEEXT=''
CC='/home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64'
CCSHARED=''
CFLAGS=' -fPIC --sysroot=/home/roberto/dev/tools/android/ndk/sysroot -D__ANDROID_API__=21 -isystem /home/roberto/dev/tools/android/ndk/sysroot/usr/include/arm-linux-androideabi -I/home/roberto/dev/tools/android/ndk/sysroot/usr/include'
CFLAGSFORSHARED=''
CFLAGS_ALIASING=''
CFLAGS_NODIST=''
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=''
CONFIG_ARGS=' '\''--host=arm-linux-androideabi'\'' '\''--build=x86_64-pc-linux-gnu'\'' '\''--enable-shared'\'' '\''--disable-ipv6'\'' '\''ac_cv_file__dev_ptmx=yes'\'' '\''ac_cv_file__dev_ptc=no'\'' '\''--without-ensurepip'\'' '\''ac_cv_little_endian_double=yes'\'' '\''--prefix=/usr/local'\'' '\''--exec-prefix=/usr/local'\'' '\''--with-openssl=/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1'\'' '\''build_alias=x86_64-pc-linux-gnu'\'' '\''host_alias=arm-linux-androideabi'\'' '\''CC=/home/roberto/dev/tools/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-none-linux-androideabi -gcc-toolchain /home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64'\'' '\''CFLAGS= -fPIC --sysroot=/home/roberto/dev/tools/android/ndk/sysroot -D__ANDROID_API__=21 -isystem /home/roberto/dev/tools/android/ndk/sysroot/usr/include/arm-linux-androideabi -I/home/roberto/dev/tools/android/ndk/sysroot/usr/include'\'' '\''LDFLAGS= --sysroot=/home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm -L/home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm/usr/lib -L/home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm/usr/lib -L/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3/obj/local/armeabi-v7a -L/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/.libs -L. -fuse-ld=lld -L/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1'\'' '\''LIBS= -lsqlite3 -lffi -lcrypto1.1 -lssl1.1'\'' '\''CPPFLAGS= -fPIC --sysroot=/home/roberto/dev/tools/android/ndk/sysroot -D__ANDROID_API__=21 -isystem /home/roberto/dev/tools/android/ndk/sysroot/usr/include/arm-linux-androideabi -I/home/roberto/dev/tools/android/ndk/sysroot/usr/include -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3 -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include/internal -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include/openssl'\'' '\''PKG_CONFIG_PATH=/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi'\'''
CPP=''
CPPFLAGS=' -fPIC --sysroot=/home/roberto/dev/tools/android/ndk/sysroot -D__ANDROID_API__=21 -isystem /home/roberto/dev/tools/android/ndk/sysroot/usr/include/arm-linux-androideabi -I/home/roberto/dev/tools/android/ndk/sysroot/usr/include -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3 -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include/internal -I/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include/openssl'
CXX=''
DEFS=''
DEF_MAKE_ALL_RULE=''
DEF_MAKE_RULE=''
DFLAGS=''
DLINCLDIR=''
DLLLIBRARY=''
DTRACE=''
DTRACE_HEADERS=''
DTRACE_OBJS=''
DYNLOADFILE=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENSUREPIP=''
EXEEXT=''
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
EXT_SUFFIX=''
FRAMEWORKALTINSTALLFIRST=''
FRAMEWORKALTINSTALLLAST=''
FRAMEWORKINSTALLAPPSPREFIX=''
FRAMEWORKINSTALLFIRST=''
FRAMEWORKINSTALLLAST=''
FRAMEWORKPYTHONW=''
FRAMEWORKUNIXTOOLSPREFIX='/usr/local'
GITBRANCH=''
GITTAG=''
GITVERSION=''
GNULD=''
GREP=''
HAS_GIT='no-repository'
HAVE_GETHOSTBYNAME=''
HAVE_GETHOSTBYNAME_R=''
HAVE_GETHOSTBYNAME_R_3_ARG=''
HAVE_GETHOSTBYNAME_R_5_ARG=''
HAVE_GETHOSTBYNAME_R_6_ARG=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
INSTSONAME=''
LDCXXSHARED=''
LDFLAGS=' --sysroot=/home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm -L/home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm/usr/lib -L/home/roberto/dev/tools/android/ndk/platforms/android-21/arch-arm/usr/lib -L/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3/obj/local/armeabi-v7a -L/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/.libs -L. -fuse-ld=lld -L/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1'
LDLAST=''
LDLIBRARY=''
LDLIBRARYDIR=''
LDSHARED=''
LDVERSION=''
LIBC=''
LIBFFI_INCLUDEDIR=''
LIBM=''
LIBOBJS=''
LIBPL=''
LIBRARY=''
LIBS=' -lsqlite3 -lffi -lcrypto1.1 -lssl1.1'
LIBTOOL_CRUFT=''
LINKCC=''
LINKFORSHARED=''
LIPO_32BIT_FLAGS=''
LLVM_PROFDATA=''
LLVM_PROF_ERR=''
LLVM_PROF_FILE=''
LLVM_PROF_FOUND=''
LLVM_PROF_MERGER=''
LN=''
LTLIBOBJS=''
MACHDEP='linux'
MACHDEP_OBJS=''
MAINCC=''
MKDIR_P=''
MULTIARCH=''
MULTIARCH_CPPFLAGS=''
NO_AS_NEEDED=''
OBJEXT=''
OPENSSL_INCLUDES=''
OPENSSL_LDFLAGS=''
OPENSSL_LIBS=''
OPT=''
OTHER_LIBTOOL_OPT=''
PACKAGE_BUGREPORT='https://bugs.python.org/'
PACKAGE_NAME='python'
PACKAGE_STRING='python 3.7'
PACKAGE_TARNAME='python'
PACKAGE_URL=''
PACKAGE_VERSION='3.7'
PATH_SEPARATOR=':'
PGO_PROF_GEN_FLAG=''
PGO_PROF_USE_FLAG=''
PKG_CONFIG=''
PKG_CONFIG_LIBDIR=''
PKG_CONFIG_PATH='/home/roberto/dev/tools/android/buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi'
PLATFORM_TRIPLET=''
PY3LIBRARY=''
PYTHONFRAMEWORK=''
PYTHONFRAMEWORKDIR='no-framework'
PYTHONFRAMEWORKIDENTIFIER='org.python.python'
PYTHONFRAMEWORKINSTALLDIR=''
PYTHONFRAMEWORKPREFIX=''
PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) python3.7'
PYTHON_FOR_REGEN='python3.7'
PY_ENABLE_SHARED=''
READELF='/home/roberto/dev/tools/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-readelf'
RUNSHARED=''
SED=''
SHELL='/bin/sh'
SHLIBS=''
SHLIB_SUFFIX=''
SOABI=''
SOVERSION='1.0'
SRCDIRS=''
TCLTK_INCLUDES=''
TCLTK_LIBS=''
THREADHEADERS=''
TRUE=''
UNIVERSALSDK=''
UNIVERSAL_ARCH_FLAGS=''
VERSION='3.7'
_PYTHON_HOST_PLATFORM='linux-arm'
ac_ct_AR=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_READELF=''
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias='x86_64-pc-linux-gnu'
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='/usr/local'
host='arm-unknown-linux-androideabi'
host_alias='arm-linux-androideabi'
host_cpu='arm'
host_os='linux-androideabi'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target=''
target_alias=''
target_cpu=''
target_os=''
target_vendor=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define _GNU_SOURCE 1
#define _NETBSD_SOURCE 1
#define __BSD_VISIBLE 1
#define _DARWIN_C_SOURCE 1
#define _PYTHONFRAMEWORK ""
#define _XOPEN_SOURCE 700
#define _XOPEN_SOURCE_EXTENDED 1
#define _POSIX_C_SOURCE 200809L

configure: exit 77

I am not sure how to help :(

@Aralox
Copy link
Contributor Author

Aralox commented Mar 18, 2019

Hi Robert, thank you for testing my branch! Try installing lld then try again.

(deduced from clang: error: invalid linker name in argument '-fuse-ld=lld')

@robertpro
Copy link

Thank you @Aralox I was reading ldd instead of lld LOL

BTW, I can confirm your change is correct, if fixes x86 build and still working with armeabi-v7a (I don't have any arm64-v8a device to test ), but my p4a or Kivy knowledge in general is too little, so I can not be sure this won't broke anything.

Be sure you add lld to the dependencies

For Fedora 29

sudo dnf install lld

Good work!

@AndreMiras
Copy link
Member

Thanks to you both, it actually useful to see that error messaging popping up.
Just wondering @Aralox is the system lld system dependency really required currently on the Docker container? Since clang is only picked up on WSL right? Or would the error also pop in the Docker env?
I'll try play with the PR see if it doesn't introduce any obvious regression and merge hopefully (early) this week.
Thank you both for the contributions!

@AndreMiras AndreMiras self-assigned this Mar 18, 2019
@Aralox
Copy link
Contributor Author

Aralox commented Mar 18, 2019

Can confirm clang is used to compile libffi in the docker container, so the dependency on lld is required there. Thanks Andre!

@AndreMiras
Copy link
Member

Awesom work @Aralox! It seems to work and you also simplified the code, thanks!

I've tried compiling an app without lld, but also skipping that line env["LDFLAGS"] += ' -L. -fuse-ld=lld'.
If I don't skip that line and if I don't have the lld linker binary installed then indeed the compilation fails.
So I'm a bit concerned about adding a mandatory dependency that was previously not required on some systems e.g. Ubuntu 18.04. Basically on theses systems things would suddenly broke. So I made a suggestion in the diff to make this dep optional.
Then you can probably also remove it from the Dockerfile to prove the point in the tests itself.
It's good because it gives more modularity without introducing much complexity. And since the lld dep is not mandatory anymore we don't have to update the documentation either.

@robertpro
Copy link

robertpro commented Mar 18, 2019

@AndreMiras may be ubuntu docs won't need an update, but I think Fedora will, I can add that dependency for Fedora if you guys want

@AndreMiras
Copy link
Member

Sure @robertpro you can pull request the Fedora docs once #1744 gets merged. I'm also exited about it being merged, just want @Aralox to take a final look at my last comment to make it optional and I'll merge. It's definitely on my top prio this week 😃

@Aralox
Copy link
Contributor Author

Aralox commented Mar 19, 2019

Hey Andre, sorry for the confusion, I don't think I explained very well in my initial post, but to fix the libffi compile, I discovered that lld was not actually required at all. Using it initially fixed compile issues, but I realised that the root cause was deeper which was why I went ahead and fixes the recipe.
It's possible to remove the ldflags line and the python patch, the fix will still work. I left it in because I find lld much nicer to work with overall. Having a check to determine if the fuse ld flag is required creates unnecessary confusion. We should go all or nothing with this in my opinion. Either always use lld and embrace the dependency or don't use it at all. Thank you for the help with this pr :). I'll only be free to make code changes on Friday probably, if required.

Edit: sorry again! I misread your comment, I thought the exitcode referred to the libffi compile. What you have suggested with the check for lld existence makes perfect sense, it allows backwards compatibility, and gives developers a clear step to take if the libffi compile fails. Yeah it looks great. Quite busy this week but will try to squeeze in the change one of these nights

@AndreMiras
Copy link
Member

Great I've read your edit and yes you exactly got my point, it should smooth the transition to lld 👍
Thanks again taking time to address this 🤗
Looking forward to merging it soon 😄

Changed hardcoded cpu count to cpu_count().
Added comment to python patch.
Made remove-fix-cortex-a8.patch conditional on lld.
Moved LDFLAGS change to get_recipe_env() so its not libffi specific
within python.py.
@Aralox
Copy link
Contributor Author

Aralox commented Mar 20, 2019

The Travis CI build seems to use python 2.7 for tox, which is unhappy about subprocess.getstatusoutput(). How do we sort this out? Thanks

.tox/py27/lib/python2.7/site-packages/pythonforandroid/recipes/python3/__init__.py:6: in <module>
...
>       exitcode, _ = subprocess.getstatusoutput('which lld')
E       AttributeError: 'module' object has no attribute 'getstatusoutput'

@AndreMiras
Copy link
Member

Thanks for the update @Aralox! And that Python2 is super annoying, but glad the CI could catch that.
Maybe you could try the sh module:

import sh
assert sh.which('foobar') is None
assert sh.which('ls') is not None

Otherwise with subprocess.Popen it seems https://stackoverflow.com/a/26044112/185510

@Aralox
Copy link
Contributor Author

Aralox commented Mar 20, 2019

Nice man, you are really quick! I've changed it as you suggested, I think it looks better too. I'll see how it goes tomorrow, I definitely need to sleep now! 😴

@AndreMiras
Copy link
Member

AndreMiras commented Mar 20, 2019

It looks pretty good thanks. I'll test it again without lld on one of my apps probably today. I let you test it on your side with lld and let us know if it's ready for the merge.

Edit:
So I gave it a try with your recent update and it works both compile time and run time without lld.
Also since having lld is currently undocumented we should probably remove it from the Dockerfile, or we should document this as recommended dependency

@Aralox
Copy link
Contributor Author

Aralox commented Mar 20, 2019

I tested with and without lld on armv7 and x86 emulators, all looks fine. Happy to drop it from the docker file tonight, or it looks like github has a feature where you can suggest an edit right here and I can click accept, maybe we can give that a go? I'm on my phone

@AndreMiras
Copy link
Member

I've dropped it. I'll squash and merge if the build goes green.
Thanks again for all the effort and patience 🍺

Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build is green, ready for the merge

@AndreMiras AndreMiras merged commit f16a665 into kivy:master Mar 20, 2019
@Aralox
Copy link
Contributor Author

Aralox commented Mar 21, 2019

I'm just messing around in the same general area of code, and saw that isysroot and isystem flags use a space between the key and value in the same way that sysroot did previously. Ideally this should be replaced with an equals sign to avoid any annoyances with libtool in the future. Anyway, just a thought, might be good to address in the next PR which touches python.py, archs.py etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants