首页 文章

交叉编译openssl for linux arm-v5te-linux-gnueabi工具链

提问于
浏览
5

交叉编译openssl for linux arm-v5te-linux-gnueabi工具链 . 我有版本openssl-0.9.8r我试过./Configure --prefix = / usr --openssldir = / usr / sbin threads zlib shared no-asm linux-armv4 export CROSS_COMPILE = arm-v5te-linux-gnueabi-

但没有用 .

我非常需要按照基本步骤将其交叉编译为openssl二进制文件 . 我已经在链接上尝试了多个建议,因此迫切需要打开一个新问题 .

请帮忙

2 回答

  • 5

    这个工作:

    ./Configure linux-generic32 shared  -DL_ENDIAN --prefix=/home --openssldir=/home
    make CC=arm-v4t-linux-gnueabi-gcc RANLIB=arm-v4t-linux-gnueabi-ranlib LD=arm-v4t-linux-gnueabi-ld MAKEDEPPROG=arm-v4t-linux-gnueabi-gcc PROCESSOR=ARM
    
  • 3

    我遇到了同样的问题并写了一本关于如何交叉编译openssl for arm的手册 . 我希望本手册能给你一些想法:

    这个过程非常简单 . 在本手册中,我们将给出一个在Ubuntu Linux系统中交叉编译ARM体系结构的OPENSSL的示例 .

    • 交叉编译器

    您将需要用于ARM体系结构的GNU C / C编译器:

    $ sudo apt-get install gcc-4.8-arm-linux-gnueabihf g -4.8-arm-linux-gnueabihf

    • openssl源代码(版本1.1.1)

    我们将构建的openssl可在https://github.com/openssl/openssl获取

    $ git clone https://github.com/openssl/openssl.git

    • 配置

    导航到openssl文件夹,然后执行./configure,如下所示:

    $ ./Configure linux-armv4 --prefix = / usr / local / openssl / --openssldir = / usr / local / openssl shared

    此配置设置目标平台linux-armv4,这是此openssl支持的唯一可用ARM平台 . --prefix = / usr / local / openssl告诉安装文件的放置位置 . --openssldir = / usr / local / openssl定义openssl安装的根目录 . shared使编译器生成.so库文件 . 文件夹openssl下的文件INSTALL包含./Configure的参数 .

    • 编译

    $ make CC = arm-linux-gnueabihf-gcc-4.8

    CC告诉我们使用什么交叉编译器 . 默认编译器是gcc .

    • 安装

    $ make install

    • 输出

    安装后,您将在/ usr / local / openssl下找到以下文件和文件夹

    $ ls / usr / local / openssl

    箱子

    ct_log_list.cnf

    包括

    杂项

    openssl.cnf.dist

    分享证书

    ct_log_list.cnf.dist

    LIB

    openssl.cnf中

    私人的

    • 结束

    确保为ARM构建可执行二进制文件:

    $ file / usr / local / openssl / bin / openssl

    install-arm / bin / openssl:ELF 32位LSB可执行文件,ARM,EABI5版本1(SYSV),动态链接,解释器/lib/ld-linux-armhf.so.3,适用于GNU / Linux 3.2.0,BuildID [sha1] = a23306c9c8bd553183fc20a37a60dcac8291da91,未剥离

    如果您看到与上面显示的内容类似的内容,则您已成功交叉编译ARM系统的openssl .

相关问题