当前位置:网站首页>解决undefined reference to `__aeabi_uidivmod‘和undefined reference to `__aeabi_uidiv‘错误
解决undefined reference to `__aeabi_uidivmod‘和undefined reference to `__aeabi_uidiv‘错误
2022-07-03 09:48:00 【smartvxworks】
自己写裸机驱动程序时,使用了除法,在链接的时候出了如下错误:
使用的编译器是:
后来上网搜了一下原因,由于编译器不支持除法运算,但是也没有搜到解决方案。看了一下代码确实用到了除法,把除法去掉可以正常连接通过。后来想了想了,之前编译内核和编译u_boot都是这个编译器的呀,他们肯定有除法运算呀,他们是怎么做到的呢?
于是看了一下u_boot的Makefile,很晕,东西很多,后来编译了一下,看到了这个:
u_boot在链接的时候,指定了黄色颜色的路径和-lgcc选项(-l后面的是链接库的名字)
到指定的目录下看到如下内容:
里面有一个libgcc.a的静态库,编译器支持软浮点,猜想软浮点的实现应该就是在找个静态库中。
在自己的Makefile里面加上了这些东西,继续编译连接出现如下错误信息:
缺少"raise符号",在u_boot源码中搜索"raise"如下:
是一个函数,什么也没干,我在自己的代码中写了一个这样的空函数,编译通过。
Makefile 如下:
总结:
ARMv4t的ARM核不支持浮点运算,为了让其支持浮点运算,编译器使用了软浮点的方法,但是需要相应的除法库支持,在连接的时候需要指定其路径和库名。
一句经典名言: 在IT行业,遇到问题,只要一直解决,总有解决的一天。
边栏推荐
- 如何让让别人畏惧你
- Qt:qss custom qheaderview instance
- Probability theory: application of convolution in calculating moving average
- The testing department of the company came to the king of the Post-00 roll, and the veteran exclaimed that it was really dry, but
- T5 attempt
- Extern keyword
- Flink < --> how to use redis +with parameter
- 硬 货 | 一改测试步骤代码就全写?为什么不试试用 Yaml实现数据驱动?
- Internet Socket (非)阻塞write/read n个字节
- Win10系统下提示“系统组策略禁止安装此设备”的解决方案(家庭版无组策略)
猜你喜欢
Cause: org. apache. ibatis. builder. Builderexception: error parsing SQL mapper configuration problem analysis
Clion debug
多路IO转接——前导
Some abilities can't be learned from work. Look at this article, more than 90% of peers
【Proteus仿真】74HC154 四线转12线译码器组成的16路流水灯
redis那些事儿
嵌入式軟件測試怎麼實現自動化測試?
UI自动化测试如何走出困境?价值又如何体现?
软件测试必学基本理论知识——APP测试
How to realize automatic testing in embedded software testing?
随机推荐
The solution that prompts "system group policy prohibits the installation of this device" under win10 system (home version has no group policy)
IIS does not take effect after modifying the configuration information
Logstash backup tracks the data records reported
文件上传下载测试点
有赞CTO崔玉松:有赞Jarvis核心目标是使产品变得更加聪明和可靠
QT:QSS自定义 QTreeView实例
In the middle of the year, I have prepared a small number of automated interview questions. Welcome to the self-test
Overview of testing theory
Qt:qss custom qpprogressbar instance
月薪过万的测试员,是一种什么样的生活状态?
QT:QSS自定义QMenu实例
Qt:qss custom qmenubar instance
File upload and download test point
Use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B
Qt:qss custom QSlider instance
QT: QSS custom qtabwidget and qtabbar instances
QT:QSS自定义QGroupBox实例
QT:QSS自定义QToolBar和QToolBox实例
Latest sales volume of pinduoduo
Communication software development and Application