linux内核中的浮动比较给出了链接错误

Jee*_*tel 0 c linux floating-point linux-kernel

在linux内核模块中我有下面的代码.

float temp
temp = some_function();
if(temp < 0.0f) {
printk("error");
}
Run Code Online (Sandbox Code Playgroud)

我正在arm使用arm-none-linux-gnueabi-工具链交叉编译平台

我在这条线上得到了以下错误 if(temp < 0.0f) {

未定义的引用`__aeabi_fcmplt

我不明白为什么会发生这种情况.我是否缺少makefile中的任何链接?

R..*_*R.. 5

最后我检查了Linux内核中不允许的浮点数.由于您正在构建的cpu arch和ABI不支持硬件浮点,因此GCC正在生成对内核中不可用的软浮点函数的调用.