This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
undefined reference to `__stack_chk_fail'
- From: Qihang Huang <qihang dot huang at gmail dot com>
- To: newlib at sourceware dot org
- Date: Fri, 9 Apr 2010 17:11:37 +1200
- Subject: undefined reference to `__stack_chk_fail'
Dear list,
I am "porting" new lib to replace glibc on Linux (x86_64), so that I
know new lib better before I actually port it somewhere. So right now,
all I did was implementing the system calls stubs using Linux system
calls directly, and compile new lib, and link a helloWorld.c with new
lib. Everything is fine if I am using puts() in the helloWorld
program, but if I use iprintf() instead, when I link it with "ld
-static -nostdlib -L/path/to/newlib -o hello helloWorld.o crt1.o
my_syscalls.o -lc", ld complains "./libc.a(lib_a-vfiprintf.o): In
function `_vfiprintf_r':
vfprintf.c:(.text+0x1392): undefined reference to `__stack_chk_fail'".
Any idea why is it so? And how to fix it?
Many thanks!
Cheers,
Qihang