回复: RE: 回复: Re: 求助,arm-linux内核中使用浮点用算问题。

83 views
Skip to first unread message

CL2

unread,
Jun 24, 2010, 11:38:21 PM6/24/10
to zhangleo, linux-...@zh-kernel.org
因为我用的系统是公司自己开发的实时linux,其中加入了一个实时内核,他和linux内核同处于内核域,而我要加入的算法模块必须和实时核写到一起才能被实时调度,所以导致了这种要在linux内核编译时遇到浮点运算的情况。

2010-06-25

CL2

发件人: zhangleo <zol...@hotmail.com>
发送时间: 2010-06-25 11:21
主 题: RE: 回复: Re: 求助,arm-linux内核中使用浮点用算问题。
收件人: <neverfor...@163.com>, <iamyu...@gmail.com>
抄 送: <linux-...@zh-kernel.org>

linux内核不支持浮点计算,为什么要在内核中加入浮点运算呢

> Date: Fri, 25 Jun 2010 11:17:48 +0800
> From: neverfor...@163.com
> To: iamyu...@gmail.com
> Subject: 回复: Re: 求助,arm-linux内核中使用浮点用算问题。
> CC: linux-...@zh-kernel.org
>
> 你好,CFLAS加入-mfpu=vfp后编译报错,说是无效选项。
> 另:我将编译器升级到arm-none-linux-gnueabi-gcc4.4.1,编译报错:
> cc1: error: unrecognized command line option "-mapcs-32"
> cc1: error: unrecognized command line option "-mshort-load-bytes"
>
> 2010-06-25
>
>
>
> CL2
>
>
>
> 发件人: liang yu <iamyu...@gmail.com>
> 发送时间: 2010-06-24 21:05
> 主 题: Re: 求助,arm-linux内核中使用浮点用算问题。
> 收件人: 崔磊 <neverfor...@163.com>
>
>
>
>
>
>
> 2010/6/17 崔磊 <neverfor...@163.com>
>
> 大家好,我在做一个项目需要在linux内核中添加一个算法模块,开发平台是pxa270芯片+arm-linux2.6.9 ,使用arm-linux-gcc3.4.6编译。编译内核时出现大量错误,摘取如下:
>
> RobotController/robAlgorithm/lineInterpolation/LineInterpolation.c:106: undefined reference to `__divsf3'
> RobotController/robAlgorithm/lineInterpolation/LineInterpolation.c:107: undefined reference to `__divsf3'
> RobotController/robAlgorithm/lineInterpolation/LineInterpolation.c:108: undefined reference to `__mulsf3'
> RobotController/robAlgorithm/lineInterpolation/LineInterpolation.c:108: undefined reference to `__divsf3'
> RobotController/robAlgorithm/lineInterpolation/LineInterpolation.c:108: undefined reference to `__extendsfdf2'
> RobotController/robAlgorithm/lineInterpolation/LineInterpolation.c:108: undefined reference to `__adddf3'
> RobotController/robAlgorithm/lineInterpolation/LineInterpolation.c:108: undefined reference to `__fixdfsi'
> RobotController/robAlgorithm/lineInterpolation/LineInterpolation.c:112: undefined reference to `__floatsisf'
> RobotController/robAlgorithm/lineInterpolation/LineInterpolation.c:115: undefined reference to `__mulsf3'
> 。。。。。。
>
> 分析后发现可能是因为PXA270不支持浮点运算导致。但我在编译器加了-msoft-float选项,并且内核配置了NWPFE项。
> 但现在问题依然存在。麻烦大家帮忙指点,万分感谢!!!
>
> _______________________________________________
> Linux 内核开发中文邮件列表
> Linux-...@zh-kernel.org
> http://zh-kernel.org/mailman/listinfo/linux-kernel
> Linux 内核开发中文社区: http://zh-kernel.org
> 试试 -mfpu=vfp
> _______________________________________________
> Linux 内核开发中文邮件列表
> Linux-...@zh-kernel.org
> http://zh-kernel.org/mailman/listinfo/linux-kernel
> Linux 内核开发中文社区: http://zh-kernel.org

搜索本应是彩色的,快来体验新一代搜索引擎-必应,精美图片每天换哦! 立即试用!
_______________________________________________
Linux 内核开发中文邮件列表
Linux-...@zh-kernel.org
http://zh-kernel.org/mailman/listinfo/linux-kernel
Linux 内核开发中文社区: http://zh-kernel.org

Gao Ya'nan

unread,
Jun 25, 2010, 6:49:19 AM6/25/10
to CL2, linux-...@zh-kernel.org
在内核里面使用浮点个人以为是条死胡同,在 linuxforum 里面已经回答过了,为什么不愿意尝试一下其他的办法再说呢?

Liu Yu-B13201

unread,
Jun 25, 2010, 6:55:25 AM6/25/10
to CL2, zhangleo, linux-...@zh-kernel.org

试试用嵌入汇编替代运算符?
Btw 我没试过。。

> -----Original Message-----
> From: linux-kern...@zh-kernel.org
> [mailto:linux-kern...@zh-kernel.org] On Behalf Of CL2
> Sent: Friday, June 25, 2010 11:38 AM
> To: zhangleo
> Cc: linux-...@zh-kernel.org
> Subject: 回复: RE: 回复: Re: 求助,arm-linux内核中使用浮点用算问题。
>
> 因为我用的系统是公司自己开发的实时linux,其中加入了一个实时内核,他和linux内核同处于内核域,而我要加入的算法模块必

Wan ZongShun

unread,
Jun 28, 2010, 8:15:42 AM6/28/10
to Liu Yu-B13201, linux-...@zh-kernel.org
/>> > 2010/6/17 崔磊 <neverfor...@163.com>

>> >
>> > 大家好,我在做一个项目需要在linux内核中添加一个算法模块,开发平台是pxa270芯片+arm-linux2.6.9
>> ,使用arm-linux-gcc3.4.6编译。编译内核时出现大量错误,摘取如下:
>> >
>> >
>> RobotController/robAlgorithm/lineInterpolation/LineInterpolati
>> on.c:106: undefined reference to `__divsf3'

Hi,

It has ever happened to me, I wish to help you, but it maybe not:)

'RobotController/robAlgorithm' , which seems to be your own codes
rather than Kernel,
so whether you have used this 64 bit division in your codes or not?

If yes, when link , it will try to find '__divsf3' in libgcc.a, then
no found, errors occur.

(1) add -fno-tree-scev-cprop to KBUILD_CFLAGS of kernel Makefile.
or
(2) modify your codes to use 'do_div' instead of x/y.
You can change your codes to avoid link '__divsf3' from the libgcc.a .

--
*linux-arm-kernel mailing list
mail addr:linux-ar...@lists.infradead.org
you can subscribe by:
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

* linux-arm-NUC900 mailing list
mail addr:NUC...@googlegroups.com
main web: https://groups.google.com/group/NUC900
you can subscribe it by sending me mail:
mcuo...@gmail.com

Reply all
Reply to author
Forward
0 new messages