Cross compile with OpenSSL
Hi I'm trying to cross-compile for arm64 with OpenSSL. When using cmake, findpackage searches for OpenSSL from x86 and not from the toolchain.
When compiling, the error below is generated because it uses OpenSSL from x86_64-linux-gnu
In file included from /usr/include/openssl/ssl.h:21, from /home/bitten/libhv/ssl/openssl.c:5:
/usr/include/openssl/macros.h:14:10: fatal error: openssl/opensslconf.h: No such file or directory
14 | #include <openssl/opensslconf.h>
| ^~~~~~~~~~~~~~~~~~~~~~~
Has anyone tried compiling in this scenario?
Thanks
Try cmake -DOPENSSL_ROOT_DIR=/path/to/openssl
I don't have a path where OpenSSh is located. The sysroot has the folders /usr/include and /usr/lib that contain the information for cross-compilation.
That's why -DOPENSSL_ROOT_DIR can't be set. And setting it as /usr doesn't work.
First of all, you need to have a compiled openssl library of arm64 version locally, otherwise how can you find and link openssl libraries?
I have openssl compiled in ARM64 because the sysroot variable of the toolchain points to a folder with the same structure as the OS but with all the ARM64 version libraries.