Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross compile with OpenSSL #596

Open
frbitten opened this issue Jul 28, 2024 · 4 comments
Open

Cross compile with OpenSSL #596

frbitten opened this issue Jul 28, 2024 · 4 comments

Comments

@frbitten
Copy link

frbitten commented Jul 28, 2024

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

@ithewei
Copy link
Owner

ithewei commented Jul 29, 2024

Try cmake -DOPENSSL_ROOT_DIR=/path/to/openssl

@frbitten
Copy link
Author

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.

@ithewei
Copy link
Owner

ithewei commented Jul 31, 2024

First of all, you need to have a compiled openssl library of arm64 version locally, otherwise how can you find and link openssl libraries?

@frbitten
Copy link
Author

frbitten commented Aug 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants