在CentOS 5.4中编译netfilter_queue的困难(GCC错误)

时间:2014-11-17 20:50:18

标签: c linux gcc centos netfilter

在为我的centos 5.4机器编译c库(netfilter_queue)时花了好几个小时试图弄清楚我的问题后,我非常气馁。 我正在运行centos x64 机器。

运行时./configure我看到一个错误,表明我的编译器发生了故障。 在检查了我的" config.log"文件,由./configure命令创建我看到它编译一个sanity c文件失败了(可能用来检查我的编译器是否正常工作)

错误失败:

/tmp/iuucsLU.s: Error: Suffix or operands invalid for `push`
/tmp/iuucsLU.s: Error: Suffix or operands invalid for `push`
/tmp/iuucsLU.s: Error: Suffix or operands invalid for `pop`
/tmp/iuucsLU.s: Error: Suffix or operands invalid for `pop`
/tmp/iuucsLU.s: Error: Suffix or operands invalid for `pop`
/tmp/iuucsLU.s: Error: Suffix or operands invalid for `push`

当我发现我的问题可能是gcc时,我创建了以下c文件:

#import <stdio.h>
main()
{
    return 0;
}

我将文件命名为&#39; test.c&#39;并尝试使用&#34; gcc test.c&#34;进行编译。它失败了同样的错误。 我发现我的问题可能是32/64位兼容性问题所以我试着运行它指定一个特定的汇编程序。

  1. 当我执行&#34; gcc -m32 test.c&#34;它失败了同样的错误。
  2. 当我执行&#34; gcc -m64 test.c&#34;它因以下错误而失败:

    test.c:0:抱歉,未实现:64位模式未在

  3. 中编译

    我无法弄清楚我的问题是什么,我肯定运行64位计算机。 请注意,我使用rpm从CentOS-CD提供rpm文件,手动安装了gcc及其所有依赖项。

    将非常感谢帮助。 提前谢谢,劳伦。

1 个答案:

答案 0 :(得分:0)

问题是我使用的是64位机器但是我只安装了32位gcc而我的默认汇编程序是32位,这使我的编译器感到困惑。这个问题可以通过下载特定的RPM来解决(具有讽刺意味的是,cd只提供了32位RPM,这使得无意义)。谢谢Etan!