我如何获得 C++与 AIX 上的 gcc 堆栈保护器功能链接的程序?
我是一个 AIX 新手。我正在尝试使用 gcc 的堆栈保护器功能编译程序。我使用 pware 的 GCC 包在服务器上安装了 gcc,我可以编译一个示例程序,如下所示:
#include <stdio.h>
int main(int argc,char **argv)
{
printf("hello world\n");
return 0;
}
当我打开堆栈保护器时,我得到: g++ -fstack-protector-all main.cpp collect2:未找到库 libssp_nonshared
我一直在谷歌上寻找解决方案,似乎我的 libc 需要内置一些东西,而我的则没有。是否有包含内置堆栈保护的 libc 的软件包?
g++ -v 返回
Using built-in specs.
Target: powerpc-ibm-aix5.3.0.0
Configured with: ../stage/gcc-4.2.4/configure --disable-shared --enable-threads=posix --prefix=/opt/pware --with-long-double-128 --with-mpfr=/opt/pware --with-gmp=/opt/pware
Thread model: aix
gcc version 4.2.4
I can not find libssp_nonshared.a on the system - 是否需要安装其他软件包或者它应该与 gcc 软件包一起提供?
I'm a bit of an AIX newbie. I'm trying to compile a program using gcc's stack protector feature. I installed gcc on server using pware's GCC package and I can compile a sample program like:
#include <stdio.h>
int main(int argc,char **argv)
{
printf("hello world\n");
return 0;
}
When I turn on stack-protector though, I get:
g++ -fstack-protector-all main.cpp
collect2: library libssp_nonshared not found
I've been hunting on google for a solution to this and it seems like my libc needs to have some stuff built into that mine doesn't. Is there a package out there that includes a libc with the stack protection builtin?
g++ -v returns
Using built-in specs.
Target: powerpc-ibm-aix5.3.0.0
Configured with: ../stage/gcc-4.2.4/configure --disable-shared --enable-threads=posix --prefix=/opt/pware --with-long-double-128 --with-mpfr=/opt/pware --with-gmp=/opt/pware
Thread model: aix
gcc version 4.2.4
I can not find libssp_nonshared.a on the system -- is there an additional package I need to install or should it have come with the gcc package?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这与
libc
无关:您的GCC
安装缺少libssp_nonshared.a
库。你的
“gcc --version”
说什么?它可能已配置了--disable-libssp
选项(在这种情况下,您无法使用堆栈保护工具)。更新:
我刚刚查看了
gcc-4.3.0/configure
:我大约 99% 确定这意味着 libssp(因此
-fstack-protector
)不适用于您的平台。对不起 :-(This has nothing to do with
libc
: yourGCC
installation is missinglibssp_nonshared.a
library.What does your
"gcc --version"
say? It may have been configured with--disable-libssp
option (in which case you can't use the stack protection instrumentation).Update:
I just looked in
gcc-4.3.0/configure
:I am about 99% sure this means that libssp (and therefore
-fstack-protector
) is not available for your platform. Sorry :-(