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.
means GCC can't find puts,so you should include the file which you've defined puts in it.
The man who follows the crowd will usually get no further than the crowd.
The man who walks alone is likely to find himself in places
no one has ever been before.
skyking wrote:Actually it's -fno-builtin that does the trick...
And -nostdlib to avoid linking with the libraries used on the OS that gcc is on (or -nodefaultlibs to avoid gcc provided library functions).
Hmm.. the only things I use are:
-fno-leading-underscore -ffreestanding -fpack-struct
I don't want the leading underscore, since it makes my C -> asm easier (as well as linking libraries), freestanding was so it doesn't link the regular C library (or so I thought, and it works for me, so i dunno), and pack-struct because I wanted all my structures packed unless I specifically tell it not to be (so I am 100% positive my structs are what I think they are, and if I compile for 64-bit I don't want it all breaking unless I already know it's going to). Anyways, those are the only arguments I use for gcc and my kernel and drivers compile without issue.
skyking wrote:Actually it's -fno-builtin that does the trick...
And -nostdlib to avoid linking with the libraries used on the OS that gcc is on (or -nodefaultlibs to avoid gcc provided library functions).
Hmm.. the only things I use are:
-fno-leading-underscore -ffreestanding -fpack-struct
I don't want the leading underscore, since it makes my C -> asm easier (as well as linking libraries), freestanding was so it doesn't link the regular C library (or so I thought, and it works for me, so i dunno), and pack-struct because I wanted all my structures packed unless I specifically tell it not to be (so I am 100% positive my structs are what I think they are, and if I compile for 64-bit I don't want it all breaking unless I already know it's going to). Anyways, those are the only arguments I use for gcc and my kernel and drivers compile without issue.
Yes there are different ways things can be done. -O0 is however none of them in this case...