QNX运行时错误:未知符号__stack_chk_guard [英] QNX runtime error: unknown symbol __stack_chk_guard

查看:871
本文介绍了QNX运行时错误:未知符号__stack_chk_guard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试测试QNX 6.6.0和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:

未知符号:__stack_chk_guard

unknown symbol: __stack_chk_guard

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列表中来禁用此功能"(另请参见[ -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:

一个问题[一个]可能会试图使6.6.0二进制文件在6.5.0上运行, 是所有内容都是使用-fstack-protector构建的,它依赖于 libc 中的支持.该版本不在6.5.0 libc 中,但添加了IIRC 6.5.0SP1.

One problem [one] might hit trying to get 6.6.0 binaries to run on 6.5.0, is that everything is built is with -fstack-protector, which relies on support in libc. This wasn't in the 6.5.0 libc but IIRC, 6.5.0SP1 added.

因此,在QNX 6.5.0SP1中,此问题似乎已解决.

Thus, in QNX 6.5.0SP1 this issue seems to be fixed.

这篇关于QNX运行时错误:未知符号__stack_chk_guard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆