问题描述
我正在尝试测试QNX 6.6.0和6.5.0之间的向后兼容性(以较早的).我使用SDP6.6.0编译了一个相对简单的程序,并在Neutrino 6.5.0上执行了该程序.当我执行程序时,将弹出以下运行时错误:
I'm trying to test the backward compatibility between QNX 6.6.0 and 6.5.0 (in concequence of an earlier question I've got). I compiled a relatively simple program using SDP6.6.0 and executed it on Neutrino 6.5.0. When I execute the program the follow runtime error pops up:
ldd:FATAL:无法解析所有符号
ldd:FATAL: Could not resolve all symbols
是什么原因造成的?..
What is causing this?..
(我已经找到了解决方案,但是它无法立即起作用.当我开始编写此问题时,我意识到我所犯的错误.为将来参考,我将在此处以Q& A本人提供解决方案).
推荐答案
由于QNX使用的是gcc(qcc):
Since QNX is using gcc (qcc):
在当前和较新的gcc构建中启用了缓冲区溢出检测,但是在某些(罕见和复杂)情况下,这可能会导致运行时复杂化,例如未定义的符号:__stack_chk_guard
错误.在这种情况下,可能的解决方案是通过将-fno-stack-protector
添加到gcc编译选项使用的CFLAG
列表中来禁用此功能"(另请参见[ 1 ]和 -fno-stack-protector?).
"Buffer overflow detection is enabled in the current and newer gcc builds however in some (rare and complex) cases this may result in run time complications such as undefined symbol: __stack_chk_guard
errors. In such cases a possible solution is to disable this feature by adding -fno-stack-protector
to the CFLAG
list used by gcc compilation options" (see also [1] and What is the use of -fno-stack-protector?).
另外:我发现了一个论坛线程 Ryan Mansfield(我认为QNX编译器的主要维护者)说:
Additionally: I found a forum thread where Ryan Mansfield (QNX compiler lead maintainer, I think) says:
因此,在QNX 6.5.0SP1中,此问题似乎已解决.
Thus, in QNX 6.5.0SP1 this issue seems to be fixed.
这篇关于QNX运行时错误:未知符号__stack_chk_guard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!