今天想将redhat上面的程序放到suse 10上面运行,结果遇到了这个错误:
Floating point exception
ldd的显示结果:
系统版本:
gcc版本:
glibc 版本:
貌似suse和redhat的binay是不兼容的呢 - -||
用hello world程序测试一下:
在redhat上面编译
拷贝到suse上面运行,结果还是出现Floating point exception
Google了一下,发现可以在编译的时候加入-Wl,--hash-style=sysv
扫描二维码关注公众号,回复:
9643695 查看本文章
拷贝到suse上面运行竟然正常了。
Google发现了这样一段话
Fedora (RedHat?) seems to have a different default dynamic linker hash style,
I think basically it is:
ld —hash-style=gnu ..
So without using one of:
—hash-style=both or —hash-style=sysv
The bits created won’t run on systems that don’t support this new hash
style, like SuSE 10.
OMG