开源项目在arm下的交叉编译规则整理


典型的开源项目编译方式整理,
以openssl源码的交叉编译为例,

查看源码目录

$ vim README  
$ vim INSTALL
$ vim Configure

1/查看源码介绍,
2/查看编译安装文件介绍,
3/查看配置脚本,有的话,需要就看下
一般INSTALL会提供一套完整的编译/测试/安装流程以及参数配置.

一般流程:

找到Makefile文件

存在Makefile文件

$ make CC=交叉编译工具链信息,eg:arm-linux- 或者arm-linux-gcc

不存在Makefile文件

一定是要有办法生成地,
./config或者cmake

$./config no-asm shared --cross-compile-prefix=arm-linux- --prefix=/home/guo/work/lib_src/mqtt/open_dir/opt/openssl --openssldir=/home/guo/work/lib_src/mqtt/open_dir/usr/local/ssl --libdir=/home/guo/work/lib_src/mqtt/open_dir/usr/lib

这一堆的参数含义,需要查询INSTALL等文件,甚至Configure脚本文件
当然,也可以不设置任何参数,生成Makefile后,在文件内修改
或者留待make环节 增加参数

注意:
一般的路径,要使用绝对路径

必备的make环节

$ make
或者
$ make 参数

可能的测试环节

仅为了保险起见,跑跑测试用例.

$ make test

可能的安装环节

$ make install

完整的openssl源码编译生成动态库流程

特殊需要,索引将安装的路径指定在如下的绝对路径下:

/home/guo/work/lib_src/mqtt/open_dir/

小伙伴们可以自行指定甚至默认
流程如下:

$ ./config no-asm shared --cross-compile-prefix=arm-linux- --prefix=/home/guo/work/lib_src/mqtt/open_dir/opt/openssl --openssldir=/home/guo/work/lib_src/mqtt/open_dir/usr/local/ssl --libdir=/home/guo/work/lib_src/mqtt/open_dir/usr/lib
$ make
$ make install

结果展示:

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
FASMARM v1.42 This package is an ARM assembler add-on for FASM. FASMARM currently supports the full range of instructions for 32-bit and 64-bit ARM processors and coprocessors up to and including v8. Contents: 1. ARM assembly compatibility 2. UAL and pre-UAL syntaxes 3. IT block handling 4. Alternate encodings 5. Output formats 6. Control directives 7. Data definitions 8. Defining registers lists inside macros 9. Half-precision number formatting 10. Variants supported 11. Further information 12. Version history _______________________________________________________________________________ 1. ARM assembly compatibility There are a few restrictions how the ARM instruction set is implemented. The changes are minor and mostly have a minor impact. For the most part the basic instruction outline is the same. Where possible the original style is used but there are some differences: Not everything matches the ARM ADS assembly style, where possible the original style is used but there are some differences 1) label names cannot begin with a digit 2) CPSIE and CPSID formats are changed, use "iflags_aif" form instead of "aif" (eg. "CPSIE iflags_i" instead of "CPSID i") 3) SRS with writeback must have a separating space after the mode number and before "!" (eg. "SRSDB 16 !" instead of "SRSDB 16!") 4) macro, rept, irp, format, if, virtual etc. are all significant changes from the ARM ADS, so you will need to re-write those sections of existing code Original ARM Syntax | fasmarm Syntax ----------------------+---------------------- cpsie a | cpsie iflags_a | srsdb #29! | srsdb #29 ! ;or, | srsdb 29 ! _______________________________________________________________________________ 2. UAL and pre-UAL syntaxes fasmarm supports the original pre-UAL syntax and the newer UAL syntax. These two syntaxes only affect THUMB encodings. UAL stands for: Universal Assembly Language. pre-UAL syntax is selected wi
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值