ARM学习笔记-静态库的生成与调用
程序员文章站
2022-06-04 09:03:00
...
仅用于记录开发过程中遇到的一些问题,方便日后参考。
编译好A15的静态库然后在工程中调用,出现问题:
makefile:149: recipe for target 'rtos_template_app_am572x_a15.out' failed
c:/ti/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld.exe: error: rtos_template_app_am572x_a15.out uses VFP register arguments, E:/WorkSpace/ccs_v7/sl_am5728_a15_test/Debug\libsl_am5728_a15_test.a(test.o) does not
应该是编译静态库时的配置和工程配置(-mfpu)不一致的问题,在网上搜了下,e2e里有个连接:https://community.arm.com/tools/b/blog/posts/arm-cortex-a-processors-and-gcc-command-lines
根据提示,统一了参数-mfpu=neon-vfpv4之后还是出现上述问题,后来在仔细看了下上述链接,官方建议的编译配置如下:
-mcpu=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=hard
然而在ccs中,新建工程时只会根据选择的核来指定第一个参数,后两个参数都为空,所以需要根据官网的建议设置好后两个参数。最终,静态库工程的配置和app工程的配置如下:
-mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -mfpu=neon-vfpv4
搞定!
附官网对于-mfloat-abi三种配置的说明:
- -mfloat-abi=soft -- ignore all FPU and NEON instructions, use only the core register set and emulate all floating-point operations using library calls.
- -mfloat-abi=softfp -- use the same calling conventions as -float-abi=soft, but use floating-point and NEON instructions as appropriate. This option is binary compatible with -mfloat-abi=soft and can be used to improve the performance of code that has to conform to a soft-float environment but where it is known that the relevant hardware instructions will be available.
- -mfloat-abi=hard -- use the floating-point and NEON instructions as appropriate and also change the ABI calling conventions in order to generate more efficient function calls; floating-point and vector types can now be passed between functions in the extension registers which not only saves a significant amount of copying but also means that fewer calls need to pass arguments on the stack.
上一篇: python 正文内容提取
下一篇: Mac命令行指定特定程序打开文件
推荐阅读
-
Activiti工作流学习笔记之自动生成28张数据库表的底层原理解析
-
C++学习笔记~动态库生成中的dllimport、dllexport与(.def)文件
-
tensorflow学习笔记之tfrecord文件的生成与读取
-
解决swift生成framework静态库让oc程序调用模拟器和真机都能通过的合并方法
-
聊聊Linux下的静态库与动态库的生成与使用
-
ARM学习笔记-静态库的生成与调用
-
MySQL学习笔记2:数据库表的增删改与外键认识
-
Android JNI实现Java与C/C++互相调用,以及so库的生成和调用(JNI方式调用美图秀秀so)
-
动态库静态库的生成及显式隐式调用
-
tensorflow学习笔记之tfrecord文件的生成与读取