[Cross compilation one] openssl-1.1.1 compilation

Ingenic Platform

1. Download the source code package

https://www.openssl.org/source/old/1.1.1/

Download the openssl-1.1.1 source code at https://www.openssl.org/source/

2. Enter the catalog

# tar zxvf openssl-1.1.1.tar.gz  
# cd openssl-1.1.1

3. Execution

./config no-asm no-sse2 no-ssl3 no-zlib no-bf no-camellia no-cast no-cms no-comp no-dso no-idea  no-md2 no-mdc2 no-rc2 no-rc5 no-ripemd no-seed --prefix=$(pwd)/ISVP -fPIC --cross-compile-prefix=/opt/mips-gcc472-glibc216-64bit/bin/mips-linux-uclibc-gnu-

    Parameter Description:

    no-asm: Does not use assembly code to speed up the compilation process during cross-compilation. The reason is that its assembly code does not support arm format.
    no-async: The cross-compilation tool chain does not provide the ucontext library of GNU C –prefix
    =: installation path, after compiling and installing, there will be bin, lib, include and other folders
    –cross-compile-prefix=: cross-compiling tool 

4、make

There will be an [error] at this time:

mips-linux-gnu-gcc: error: unrecognized command line option '-m64'

The solution, we open the makefile

Search for -m64 option and delete, there are two places

NF_CFLAGS=-pthread -m64

CNF_CXXFLAGS=-std=c++11 -pthread -m64

After executing make again

[Report error] as follows:

./libcrypto.so: undefined reference to `getcontext'
./libcrypto.so: undefined reference to `setcontext'
./libcrypto.so: undefined reference to `makecontext'
collect2: error: ld returned 1 exit status

 

The main reason is: mipsel-linux does not provide the ucontext library of GNU C

Solution: add no-async in config configuration

./config no-asm no-async no-sse2 no-ssl3 no-zlib no-async no-bf no-camellia no-cast no-cms no-comp no-dso no-idea  no-md2 no-mdc2 no-rc2 no-rc5 no-ripemd no-seed --prefix=$(pwd)/ISVP -fPIC --cross-compile-prefix=/opt/mips-gcc472-glibc216-64bit/bin/mips-linux-uclibc-gnu-

5.make && make install

6. Compile successfully

 

Guess you like

Origin blog.csdn.net/Swallow_he/article/details/108361551