Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - How do I build applications with stack smashing protection?: (1 Item)
   
How do I build applications with stack smashing protection?  
Hi,

I am having difficulties compiling binaries with stack smashing protection.
I am using the -fstack-protector-all flag to gcc. I receive the following error:
/opt/qnx650/host/linux/x86/usr/bin/ntoarm-ld: cannot find -lssp_nonshared

After some searching, it seems that the __stack_chk_fail and __stack_chk_guard symbols are defined in libc.so/libc.a, 
rather than in seperate libssp libraries. I experimented with creating symlinks to libc for the libraries. If I do that 
then it compiles and runs except in two (important) cases. A: if I build with -Wl,-z,now:
ldd:FATAL: Attempt to call unresolved object: Executable
ldd:FATAL: Attempt to call unresolved object: Executable
ldd:FATAL: Attempt to call unresolved object: Executable

Or B: this error if it's linked against a similarly built library:
ldd:FATAL: Unresolved symbol "__umoddi3" called from libtestlib.so

Target OS is QNX 6.5.0 on armle arch. Toolchain is from QNX momentics 6.5.0SP1.

Thanks
Sass