在x86 linux上使用软件浮点 [英] Using software floating point on x86 linux

查看:215
本文介绍了在x86 linux上使用软件浮点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在i386 linux上使用软件浮点(很容易)是否可能,而不会导致在每次调用时陷入内核的开销?我已经尝试了-msoft-float,但是看起来正常的(ubuntu)C库没有包含FP库:

  $ gcc -m32 -msoft-float -lm -o test test.c 
/tmp/cc8RXn8F.o:在函数`main'中:
test.c :( .text + 0x39):未定义引用`__muldf3'
collect2:ld返回1退出状态


解决方案

除非你想手动引导你的整个工具链,否则你可以从

Is it (easily) possible to use software floating point on i386 linux without incurring the expense of trapping into the kernel on each call? I've tried -msoft-float, but it seems the normal (ubuntu) C libraries don't have a FP library included:

$ gcc -m32 -msoft-float -lm -o test test.c
/tmp/cc8RXn8F.o: In function `main':
test.c:(.text+0x39): undefined reference to `__muldf3'
collect2: ld returned 1 exit status

Unless you want to bootstrap your entire toolchain by hand, you could start with uclibc toolchain (the i386 version, I imagine) -- soft float is (AFAIK) not directly supported for "native" compilation on debian and derivatives, but it can be used via the "embedded" approach of the uclibc toolchain.

这篇关于在x86 linux上使用软件浮点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆