undefined reference to `__stack_chk_fail' [solved]

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Srowen
Member
Member
Posts: 60
Joined: Thu Feb 26, 2009 2:31 pm
Location: Genova, ITALY

undefined reference to `__stack_chk_fail' [solved]

Post by Srowen »

hello,

i've got a problem while i try to link my kernel. in some functions, i've go the follow error message:

Code: Select all

tmp/stdio.o: In function `printf_i':
stdio.c:(.text+0x1a9): undefined reference to `__stack_chk_fail'
what does it mean?
i'm using gcc on ubuntu...
Last edited by Srowen on Sat Mar 21, 2009 5:01 pm, edited 1 time in total.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: undefined reference to `__stack_chk_fail'

Post by JamesM »

add -fno-stack-protector to your CFLAGS.
Srowen
Member
Member
Posts: 60
Joined: Thu Feb 26, 2009 2:31 pm
Location: Genova, ITALY

Re: undefined reference to `__stack_chk_fail'

Post by Srowen »

thanks... now it runs..but... why? any explanation of this error?
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

Re: undefined reference to `__stack_chk_fail'

Post by Firestryke31 »

GCC likes to do a bunch of stuff behind the scenes. It's great for application programming because all of the runtime support is already there, unfortunately in OS development you have to make the runtime support yourself. Using that flag tells GCC to not to do some of that stuff behind the scenes, so you don't have to write the stuff until much later where you have an idea as to what you need and how to do it.
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
Srowen
Member
Member
Posts: 60
Joined: Thu Feb 26, 2009 2:31 pm
Location: Genova, ITALY

Re: undefined reference to `__stack_chk_fail'

Post by Srowen »

thank's a lot.. :mrgreen: :mrgreen:
Post Reply