This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Now do I add things to Libgloss?


Andrew Stubbs wrote:
> 
> The general vibe I'm getting from the responses to my recent question
> about putting DTF in newlib, combined with some reading up on the subject,
> is that I'm coming at this from the wrong direction - I should be looking
> at putting the DTF support in libgloss (and possibly not in the netsources
> just yet).
> 
> However, libgloss does not yet support the SH (at least not properly) -
> target-libgloss is explicitly disabled in the toplevel configure, giving
> the 'configuration not supported in subdirectory' message.
> 

You will have to add it to the configure.in and specify the sh directory
as the configdir.

> Presumably this means that all the low level stuff for the SH is still in
> newlib (as it is for arm). There is an sh directory in libgloss though.
> Does anybody know what this does?
>

It just contains some ld script files that are not installed.
 
> Where can I find full documentation about putting stuff into libgloss?
> There is a rather old and brief document in libgloss, but it isn't very
> useful for my purposes.
> 

There is none.

> Failing that, could somebody please give some quick directions on what
> goes in libgloss, where it should go, how to convince it to build (I might
> be able to figure that part out, but if somebody knows that would be good)
> and how does this override the existing stuff in newlib (is it just a case
> of removing the sysdir entry in configure.host)? I have been looking, and
> will continue to look, into the other directories in libgloss for examples
> of what I need, but these are quite complicated and very few seem to
> follow the same pattern (perhaps there is one hidden in there somewhere),
> so I'm not getting very far.
> 

First of all, you add your configuration to the configure.in.  For now, I
would assume sh*-* which matches the configuration mask used in newlib.

In the configure.in file you specify the directory to configure:

  sh*-*-pe)
        configdirs="wince"
        ;;
  
  sh*-*)
        configdirs="sh"
        ;;

Note how I have placed the new configuration after the sh*-*-pe.

Now you have to populate the sh directory.  The idea is that
you want to create a library specific for your situation.  To make things
simple and to prevent conflicts in the future you should prefix all of your
files with a common prefix.  For example, "dtf-".

There are no real rules on what your files need to look like, however,
you usually provide a crt0.s file, an ld script if needed,
and a version of the low level system calls needed by newlib.  The crt0
clears the .bss area, sets up the stack, calls constructors, calls main,
exits the program, and other initialization specific duties.  Due to
historic reasons, newlib currently contains the low level system calls and a
crt0.S.  If you need to modify/override these, then you need to remove the sysdir in 
configure.host.  This can be easily done at configuration time, however, if this
is the case, it would be a good time to look at possibly moving sh to libgloss.

At this point, I would advise you to look at existing libgloss directories
and essentially copy and modify what you need to the sh directory.  For now,
don't worry about the ld scripts already there.  I would suggest looking at the 
rs6000 directory which has a good example of configure.in and Makefile.in that
builds multiple libraries from prefixed source files.

-- Jeff J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]