I ran into the same problem and wrote a manual on cross compiling openssl for the hand. I hope this guide can give you some idea:
The process is quite simple. In this guide, we will give an example for cross-compiling OPENSSL for the ARM architecture on a Linux Ubuntu system.
You will need the GNU C / C ++ compiler for the ARM architecture:
$ sudo apt-get install gcc-4.8-arm-linux-gnueabihf g ++ - 4.8-arm-linux-gnueabihf
- Openssl source code (version 1.1.1)
The generated openssl is available at https://github.com/openssl/openssl
$ git clone https://github.com/openssl/openssl.git
- Configuration
Go to the openssl folder and execute. / configure as follows:
$. / Configure linux-armv4 --prefix = / usr / local / openssl / - openssldir = / usr / local / openssl shared
In this configuration, the target linux-armv4 platform is installed, which is the only available ARM platform supported by this openssl. --prefix = / usr / local / openssl tells where to put the installation files. --openssldir = / usr / local / openssl defines the root directory of the openssl installation. shared makes a compiler to generate .so library files. The INSTALL document in the openssl folder contains options for. / Configure.
- Selection
$ make CC = arm-linux-gnueabihf-gcc-4.8
CC reports that use cross-compiler. The default compiler is gcc.
- Installation
$ make install
- Output
After installation, you will find the following files and folders in the / usr / local / openssl directory
$ ls / usr / local / openssl
bin
ct_log_list.cnf
turn on
misc
openssl.cnf.dist
share certificates
ct_log_list.cnf.dist
lib
openssl.cnf
private
- End
make sure binaries are created for ARM:
$ file / usr / local / openssl / bin / openssl
install-arm / bin / openssl: 32-bit executable file ELB, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter / lib / ld -linux-armhf.so.3, for GNU / Linux 3.2. 0, BuildID [sha1] = a23306c9c8bd553183fc20a37a60dcac8291da91, not stripping
If you see something similar to the one shown above, you have successfully compiled openssl for the ARM system.