Linking the kernel with newlib

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
User avatar
narke
Member
Member
Posts: 119
Joined: Wed Dec 26, 2007 3:37 am
Location: France

Linking the kernel with newlib

Post 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.
User avatar
Zenith
Member
Member
Posts: 224
Joined: Tue Apr 10, 2007 4:42 pm

Post by Zenith »

Are you using the guide at http://www.osdev.org/wiki/Porting_Newlib, or something else?
"Sufficiently advanced stupidity is indistinguishable from malice."
User avatar
narke
Member
Member
Posts: 119
Joined: Wed Dec 26, 2007 3:37 am
Location: France

Post by narke »

Yes, I use this guide.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post 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?
User avatar
narke
Member
Member
Posts: 119
Joined: Wed Dec 26, 2007 3:37 am
Location: France

Post 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.
Post Reply