由于“位移必须大于或等于-32768且小于或等于32767”,在aix6.1上使用g ++ 4.6.1编译失败

时间:2011-12-06 09:52:17

标签: c++ unix g++ aix

我正在尝试使用汇编程序版本6.1在aix6.1上使用g ++ 4.6.1编译c代码。

编译因以下原因而失败: -

line 3954495: 1252-171 The displacement must be greater than or equal to
    -32768 and less than or equal to 32767.
line 3955281: 1252-171 The displacement must be greater than or equal to
    -32768 and less than or equal to 32767.
line 3955395: 1252-171 The displacement must be greater than or equal to
    -32768 and less than or equal to 32767.
line 3955401: 1252-171 The displacement must be greater than or equal to
    -32768 and less than or equal to 32767.

我使用以下选项编译: -

g++ -o tcl-int-cln.o -maix64 -bbigtoc -c tcl-int-cln.C

我在aix5.3上使用gcc4.0.2编译了同一个文件。它运作良好。

当您尝试使用g ++编译大型文件时,通常会发生这种情况。我给了一个选项,但问题仍然存在。这是汇编程序问题吗?

有人可以对此有所了解,还是gcc bug或aix问题?

任何解决方法?

感谢。

3 个答案:

答案 0 :(得分:6)

自GCC 2.95以来

Known GCC bug。 GCC无法处理大量投入;然后它将汇总ld r4,X(r3)指令(相对负载,位移X),其中X大于16位。 POWER上不允许这样做。

答案 1 :(得分:1)

我正在使用GCC并遇到此编译错误。添加“-mcmodel = large”为我修复了它。

答案 2 :(得分:0)

尝试将-Wl,-bbigtoc添加到编译器标志中。如果这不起作用,请尝试添加-mminimal-toc