[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross compilation with openssl > 1.0.2


On Wed, May 19, 2021 at 11:26 AM Andrey Strunin <acrapmonster@xxxxxxxxx>
wrote:

> Thank you for the response,
>
> I am using my own cmake toolchain file that sets compiler and sysroot. It
> worked great when it was openssl 1.0.2 in sysroot.
>
> Here is the content of my toolchain.cmake file:
>
> #CMAKE Toolchain file for PowerPC
> # this one is important
> SET(CMAKE_SYSTEM_NAME Linux)
> #this one not so much
> SET(CMAKE_SYSTEM_VERSION 1)
>
> # specify the cross compiler
> SET(CMAKE_C_COMPILER
> /localhome/new_sdk/gnss_tcc-glibc_cgl/x86-linux2/ppc_e500v2-target-linux-gnu-gcc)
> SET(CMAKE_CXX_COMPILER
> /localhome/new_sdk/gnss_tcc-glibc_cgl/x86-linux2/ppc_e500v2-target-linux-gnu-g++)
>
> # where is the target environment
> SET(CMAKE_FIND_ROOT_PATH  /localhome/new_sdk/gnss_tcc-glibc_cgl/sysroot)
>
> # Local plaform dependent toolchain outputs
> SET(CMAKE_LOCAL_BASE_ROOT_PATH
>  /localhome/new_sdk/gnss_tcc-glibc_cgl/sysroot)
>
> # search for programs in the build host directories
> SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
> # for libraries and headers in the target directories
> SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
> SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
>
> Here is the output with openssl related errors:
> https://pastebin.com/raw/NrMXi5M8
>
> I should have clarified the version of libssh I am using. It's the latest
> 0.9.5. However, I have the same build issue (maybe with slightly different
> errors, but still related to openssl) with older versions (such as 0.8.9).
>
> Thanks,
> Andrey
>
>
Hello,

After checking the log you linked, I suspect cmake failed to detect the
OpenSSL version and included libcrypto-compat.c into the sources. In my
machine (Fedora 33), I see this line when running cmake to generate the
configuration:

-- Found OpenSSL: /usr/lib64/libcrypto.so (found suitable version "1.1.1k",
minimum required is "1.0.1")

Please check if cmake found the dynamic library you expected. Maybe you
will have to tweak the places where cmake searches for libraries in your
custom environment.

In my machine, the "OPENSSL_FOUND" and "OPENSSL_VERSION" are set by the
cmake module "FindOpenSSL.cmake" which is located at
/usr/share/cmake/Modules.

Regards,
Anderson

Follow-Ups:
Re: Cross compilation with openssl > 1.0.2Andrey Strunin <acrapmonster@xxxxxxxxx>
References:
Cross compilation with openssl > 1.0.2Andrey Strunin <acrapmonster@xxxxxxxxx>
Re: Cross compilation with openssl > 1.0.2Jakub Jelen <jjelen@xxxxxxxxxx>
Re: Cross compilation with openssl > 1.0.2Andrey Strunin <acrapmonster@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org