Skip to content

Cannot cross-compile for x86 arch #419

@devgianlu

Description

@devgianlu

Describe the bug
I am not able to cross-compile libssh2 for the x86 architecture because the configure script refuses to detect the openssl installation.

++ Build libssh2 x86 ++

-Will use following setting-
output             = ../libs
host_tag           = linux-x86_64
minsdkversion      = 21
target_abis        = x86
configure_params   = --with-libssl-prefix=/home/devgianlu/Desktop/aria2-android/libs/x86
fresh_build        = true
no_host            = false

prepare for x86

cc_prefix           = i686-linux-android18-
support_prefix      = i686-linux-android-
host                = i686-linux-android
install_dir         = /home/devgianlu/Desktop/aria2-android/libssh2/../libs/x86
CFLAGS              =  -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32

checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking for sed... /bin/sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i686-linux-android-strip... /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking libssh2 version... 1.9.0_DEV
checking build system type... x86_64-pc-linux-gnu
checking host system type... i686-pc-linux-android
configure: autobuild project... libssh2
configure: autobuild revision... 1.9.0_DEV
configure: autobuild hostname... devgianlu-vm
configure: autobuild timestamp... 20191006-212028
checking for style of include used by make... GNU
checking for i686-linux-android-gcc... /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang accepts -g... yes
checking for /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang option to accept ISO C89... none needed
checking whether /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang understands -c and -o together... yes
checking dependency style of /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang... gcc3
checking how to run the C preprocessor... /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for long long... yes
checking if _REENTRANT is already defined... no
checking if _REENTRANT is actually needed... no
checking if _REENTRANT is onwards defined... no
checking for library containing socket... none required
checking for library containing inet_addr... none required
checking for i686-linux-android-gcc... (cached) /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang
checking whether we are using the GNU C compiler... (cached) yes
checking whether /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang accepts -g... (cached) yes
checking for /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang option to accept ISO C89... (cached) none needed
checking whether /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang understands -c and -o together... (cached) yes
checking dependency style of /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang... (cached) gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for sshd... no
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang... /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-ld
checking if the linker (/home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-nm -B
checking the name lister (/home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to i686-pc-linux-android format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-ld option to reload object files... -r
checking for i686-linux-android-objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for i686-linux-android-dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for i686-linux-android-ar... /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-ar
checking for archiver @FILE support... @
checking for i686-linux-android-strip... (cached) /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-strip
checking for i686-linux-android-ranlib... /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-ranlib
checking command to parse /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-nm -B output from /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for i686-linux-android-mt... no
checking for mt... mt
configure: WARNING: using cross tools not prefixed with host triplet
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang supports -fno-rtti -fno-exceptions... yes
checking for /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang option to produce PIC... -fPIC -DPIC
checking if /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang PIC flag -fPIC -DPIC works... yes
checking if /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang static flag -static works... yes
checking if /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang supports -c -o file.o... yes
checking if /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang supports -c -o file.o... (cached) yes
checking whether the /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android18-clang linker (/home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... Android linker
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether byte ordering is bigendian... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for ld used by GCC... /home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-ld
checking if the linker (/home/devgianlu/Android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android-ld) is GNU ld... yes
checking for shared library run path origin... done
checking for libssl... no
checking for libgcrypt... no
checking for libmbedcrypto... no
checking for ntdef.h... no
checking for ntstatus.h... no
checking whether SecureZeroMemory is declared... no
checking for libcrypt32... no
checking for libbcrypt... no
configure: ERROR: No openssl crypto library found!
No libgcrypt crypto library found!
No mbedtls crypto library found!
No wincng crypto library found!

Specify --with-crypto=$backend and/or the neccessary library search prefix.

Known crypto backends: auto, openssl, libgcrypt, mbedtls, wincng

Same error at the end of this build.

To Reproduce
Clone the repo:
git clone --recurse-submodules https://github.com/devgianlu/aria2-android

Install the Android NDK r20 and and set the mandatory environment variables. Run ./build_all.sh: the compilation will stop at compiling libssh2 for x86.

Expected behavior
The compilation should complete like it does for armeabi-v7a and x86_64.

Version (please complete the following information):

  • OS: Ubuntu
  • libssh2 version: 1.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions