Skip to content

Linux-Bionic OpenSSL headers hack incompatible with OpenSSL 3.x #102851

Open
@jkoritzinsky

Description

@jkoritzinsky

We hack around issues trying to reference OpenSSL from our Linux-Bionic builds here:

if(FORCE_ANDROID_OPENSSL)
set(OPENSSL_CRYPTO_LIBRARY /usr/lib/x86_64-linux-gnu/libcrypto.so)
set(OPENSSL_SSL_LIBRARY /usr/lib/x86_64-linux-gnu/libssl.so)
# Things get more wrong. We need Desktop OpenSSL headers, but
# /usr/include is special cased and forbidden. We need to copy
# the headers to a different location and use them
if(NOT DEFINED OPENSSL_INCLUDE_DIR)
string(RANDOM LENGTH 24 _s)
set(OPENSSL_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${_s}/opensslheaders CACHE PATH "temporary directory")
file(MAKE_DIRECTORY ${OPENSSL_INCLUDE_DIR})
file(COPY /usr/include/openssl DESTINATION ${OPENSSL_INCLUDE_DIR})
file(GLOB_RECURSE opensslconf /usr/include/*/openssl/*conf*.h)
file(COPY ${opensslconf} DESTINATION ${OPENSSL_INCLUDE_DIR}/openssl/)
endif()
endif()

This hack works with OpenSSL 1.1 headers, but breaks with OpenSSL 3.x headers, which check the target architecture. This breaks for our linux-bionic builds, which try to build for architectures that the multilib-compatible headers aren't set up to support.

This is the cause of the break requiring #102849 and makes our linux-bionic builds incompatible with Azure Linux 3.0.

cc: @directhex @richlander @sbomer

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions