This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]