Skip to content

autotools cannot cross-build with openssl 1.1.1t for Raspbian #1116

Closed

Description

@DevAGCO

Describe the bug
When building the library with Raspberry Pi's official cross-compiling tools, and using newer version of openssl (through conan), the linker error below shows up.
Configured with CMake:
find_package(OpenSSL REQUIRED)
configure --host=arm-linux-gnueabihf --with-libssl-prefix=${OpenSSL_LIB_DIRS}/..

To Reproduce
Build the project as a CMake "ExternalProject" using the official Raspberry Pi cross-compiling tools: https://github.com/raspberrypi/tools.

Interesting observation:

  • it builds fine with older version of openSSL (1.0.2s)

Expected behavior
Building smoothly.

Version (please complete the following information):

  • Ubuntu 20.04
  • libssh2 version: 1.11.0
  • openSSL version: 1.1.1t

Additional context
Error message:

../../staging/usr/lib/libssh2.a(crypto.o): In function `_libssh2_cipher_init':
crypto.c:(.text+0xa4c): undefined reference to `EVP_CIPHER_CTX_init'
../../staging/usr/lib/libssh2.a(crypto.o): In function `_libssh2_openssl_crypto_init':
crypto.c:(.text+0xc90): undefined reference to `OPENSSL_add_all_algorithms_noconf'
crypto.c:(.text+0xc94): undefined reference to `OpenSSL_add_all_ciphers'
crypto.c:(.text+0xc98): undefined reference to `OpenSSL_add_all_digests'
../../staging/usr/lib/libssh2.a(crypto.o): In function `_libssh2_sha1_init':
crypto.c:(.text+0x2858): undefined reference to `EVP_MD_CTX_init'
../../staging/usr/lib/libssh2.a(crypto.o): In function `_libssh2_sha1':
crypto.c:(.text+0x28a8): undefined reference to `EVP_MD_CTX_init'
../../staging/usr/lib/libssh2.a(crypto.o): In function `_libssh2_sha256_init':
crypto.c:(.text+0x292c): undefined reference to `EVP_MD_CTX_init'
../../staging/usr/lib/libssh2.a(crypto.o): In function `_libssh2_sha256':
crypto.c:(.text+0x297c): undefined reference to `EVP_MD_CTX_init'
../../staging/usr/lib/libssh2.a(crypto.o): In function `_libssh2_sha384_init':
crypto.c:(.text+0x2a00): undefined reference to `EVP_MD_CTX_init'
../../staging/usr/lib/libssh2.a(crypto.o):crypto.c:(.text+0x2a50): more undefined references to `EVP_MD_CTX_init' follow
../../staging/usr/lib/libssh2.a(crypt.o): In function `crypt_dtor':
crypt.c:(.text+0x1b0): undefined reference to `EVP_CIPHER_CTX_cleanup'
../../staging/usr/lib/libssh2.a(mac.o): In function `mac_method_hmac_sha2_512_hash':
mac.c:(.text+0xdc): undefined reference to `HMAC_CTX_init'
mac.c:(.text+0x180): undefined reference to `HMAC_CTX_cleanup'
../../staging/usr/lib/libssh2.a(mac.o): In function `mac_method_hmac_sha2_256_hash':
mac.c:(.text+0x1c8): undefined reference to `HMAC_CTX_init'
mac.c:(.text+0x26c): undefined reference to `HMAC_CTX_cleanup'
../../staging/usr/lib/libssh2.a(mac.o): In function `mac_method_hmac_sha1_hash':
mac.c:(.text+0x2b4): undefined reference to `HMAC_CTX_init'
mac.c:(.text+0x358): undefined reference to `HMAC_CTX_cleanup'
../../staging/usr/lib/libssh2.a(mac.o): In function `mac_method_hmac_md5_hash':
mac.c:(.text+0x418): undefined reference to `HMAC_CTX_init'
mac.c:(.text+0x4bc): undefined reference to `HMAC_CTX_cleanup'
../../staging/usr/lib/libssh2.a(mac.o): In function `mac_method_hmac_ripemd160_hash':
mac.c:(.text+0x57c): undefined reference to `HMAC_CTX_init'
mac.c:(.text+0x620): undefined reference to `HMAC_CTX_cleanup'
collect2: error: ld returned 1 exit status

Activity

  1. vszakats commented on Jul 11, 2023

    @vszakats
    Member

    Can you post the complete build log?

  2. changed the title [-]libssh2 cannot build with latest openssl (1.1.1t) on Rasbian[/-] [+]libssh2 cannot cross-build with openssl 1.1.1t for Raspbian[/+] on Jul 12, 2023
  3. changed the title [-]libssh2 cannot cross-build with openssl 1.1.1t for Raspbian[/-] [+]autotools cannot cross-build with openssl 1.1.1t for Raspbian[/+] on Jul 12, 2023
  4. vszakats commented on Jul 13, 2023

    @vszakats
    Member

    We would need a verbose log output for a failing build to see what is happening. Cross-builds are prone to pick up the wrong/mismatched header / lib, which seems to be a likely cause in this case as well.

  5. DevAGCO commented on Jul 13, 2023

    @DevAGCO
    Author

    Can't reproduce...
    Managed to build with 1.1.1u succesfully today.

  6. vszakats commented on Jul 13, 2023

    @vszakats
    Member

    Thanks for your feedbacks @DevAGCO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions