当前位置:网站首页>解决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行业,遇到问题,只要一直解决,总有解决的一天。
边栏推荐
- 【蓝桥杯选拔赛真题44】Scratch消灭骷髅军团 少儿编程scratch蓝桥杯选拔赛真题讲解
- Basic usage of sqlmap
- How can UI automated testing get out of trouble? How to embody the value?
- How to realize automatic testing in embedded software testing?
- Crawl with requests
- STM32F1与STM32CubeIDE编程实例-TM1637驱动4位7段数码管
- ByteDance layoffs, test engineers were almost destroyed: how terrible is the routine behind the recruitment of large factories?
- MAUI Developer Day in GCR
- Extern keyword
- Qt:qss custom qgroupbox instance
猜你喜欢

Snownlp emotion analysis

QT: QSS custom qtreeview instance

MAUI Developer Day in GCR

QT:QSS自定义 QTreeView实例

现在零基础转行软件测试还OK吗?

软件测试工程师的5年之痒,讲述两年突破瓶颈经验

我,大厂测试员,降薪50%去国企,后悔了...

那些一門心思研究自動化測試的人,後來怎樣了?

【Proteus仿真】74HC154 四线转12线译码器组成的16路流水灯

I, a tester from a large factory, went to a state-owned enterprise with a 50% pay cut. I regret it
随机推荐
Is it OK to test the zero basis software?
What is the salary level of 17k? Let's take a look at the whole interview process of post-95 Test Engineers
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
Differences among norm, normalize and normalized in eigen
Use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B
Rollup, cube and grouping sets functions of grouping functions
最高月薪18K 拥有好的“心态和选择”, 成功就差“认真和坚持”~
How to realize automatic testing in embedded software testing?
UI自动化测试如何走出困境?价值又如何体现?
反正切熵(Arctangent entropy):2022.7月最新SCI论文
My understanding of testing (summarized by senior testers)
8年测试工程师总结出来的《测试核心价值》与《0基础转行软件测试超全学习指南》
Multiple IO transfer - preamble
In the middle of the year, I have prepared a small number of automated interview questions. Welcome to the self-test
软件测试工程师的5年之痒,讲述两年突破瓶颈经验
如何让让别人畏惧你
2021 reading summary (continuously updating)
月薪过万的测试员,是一种什么样的生活状态?
字节跳动大裁员,测试工程师差点遭团灭:大厂招人背后的套路,有多可怕?
QT: QSS custom qtreeview instance