Porting Newlib: Difference between revisions

m
Made the Jeff Johnston quote a bit easier to read by removing the excessive newlines.
[unchecked revision][unchecked revision]
m (Syntax highlighting. FIXME: the asm one is borked -- does this extension support AT&T syntax?)
m (Made the Jeff Johnston quote a bit easier to read by removing the excessive newlines.)
Line 266:
 
According to Jeff Johnston on the newlib mailing list:
 
<pre>
''So, you get the majority of the C library from newlib and the rest (syscalls) is usually in libgloss. Using an ld script makes life easy for the end-user as all they have to do is specify -Txxxx.ld. Inside the ld script you can specify all the libraries needed, where the entry point is, etc.... The libgloss library is a separate library and you name it whatever you want. The ld script handles all of this internally and the user doesn't need to know just what libraries there are out there.''
So, you get the majority of the C library from newlib and the rest
(syscalls) is usually in
libgloss. Using an ld script makes life easy for the end-user as all
they have to do is
specify -Txxxx.ld. Inside the ld script you can specify all the
libraries needed, where
the entry point is, etc.... The libgloss library is a separate library
and you name it whatever
you want.
The ld script handles all of this internally and the user doesn't need
to know just what
libraries there are out there.
</pre>
 
Basically, in the libgloss directory you will find 17 files, all of which are the syscalls we wrote earlier. Put your code into these files, configure, build and then you'll have another library. Typically you would rename this library to something like "youros.a" (in my case "mattise.a") and tell all programmers to link with the linker script you write. An added bonus of this is that every executable for your OS uses a link script you've created.
252

edits