basic questions

J. Johnston jjohnstn@cygnus.com
Tue Dec 21 12:53:00 GMT 1999


Peter Popov wrote:
> 
> I've successfully built a powerpc-eabi cross compiler
> including the newlib-1.8.2 release.  I've never used
> newlib before and have some rather basic questions
> for which I couldn't find any documentation.  After
> building the cross compiler, in the lib directory I ended up
> with:
> 
> ads.ld      le/       libiberty.a  libnosys.a*         lin/       sim-crt0.o
> ca/         libads.a  libm.a       libsim.a            mbx.ld     yellowknife.ld
> crt0.o      libc.a    libmbx.a     libstdc++.a.2.10.0  mbx.specs
> ldscripts/  libg.a    libmvme.a    libyk.a             nof/
> 
> What I don't understand is why are there some many copies of the
> same libraries? libc.a, for example, is in this directory, plus
> in a whole bunch of other subdirectories:
> 
> #find . -name libc.a
> 
> ./nof/le/ca/libc.a
> ./nof/le/libc.a
> ./nof/libc.a
> ./nof/ca/libc.a
> ./le/ca/libc.a
> ./le/libc.a
> ./ca/libc.a
> ./lin/libc.a
> ./libc.a
> 
> I understand the "le", little-endian, subdirectory name, but
> not the rest. Any tips would be appreciated.  Please respond
> directly since I'm not on the list.
> 

They are not the same libraries.  Each is built with different options.
The following options correspond to the directory names:

      nof   -msoft-float
      le    -mlittle
      ca    -mcall-aix
      lin   -mcall-linux

Where there are multiple subdirectories, there are multiple options.
/nof/le/ca/libc.a is a library built with -msoft-float -mlittle -mcall-aix

The linker will use the appropriate library based on your compile options.  
For example, if you build your application with -msoft-float, you don't want the linker
to link in a C library that uses floating point instructions.  The linker knows to
use the library out of the nof sub-directory.

-- Jeff Johnston (Cygnus Solutions)


More information about the Newlib mailing list