Page 1 of 1

Linking the kernel with newlib

Posted: Wed Apr 16, 2008 1:33 pm
by narke
Hello,

I made cross compiler with --with-headers and --with-newlib, as you guess I dida very basic newlib port attempt.

I want to link the C functions of newlib to use them in a flat memory model.
Inside the kernel.

But when I compile, some errors are found in header files, things like:
syntax error before "size_t"

I really doubt that newlib is so buggy.
I also use the home made gcc cross compiler from the makefile.

So what can be wrong?
Does anyone linked some newlib stuff with success? How?

Thanks in advance.

P.S:
I just tried to use strstr() function.
It does not need any OS dependent routine.

Posted: Wed Apr 16, 2008 4:45 pm
by Zenith
Are you using the guide at http://www.osdev.org/wiki/Porting_Newlib, or something else?

Posted: Thu Apr 17, 2008 12:46 am
by narke
Yes, I use this guide.

Posted: Thu Apr 17, 2008 1:22 am
by JamesM
What exactly do the error messages say when you compile newlib? Is it possible you're still trying to build with -nostdlib and -nostdinc?

Posted: Thu Apr 17, 2008 11:41 am
by narke
Thanks, I knew about this "tricks" but I forgot to remove -nostdlib, -nostdinc and -freestanding from the CFLAG options of the Makefile.

I removed them.
Now it compiles fine.