Building Newlib Independently of GCC

J. Johnston
Fri Aug 3 21:40:00 GMT 2001

Andrew Stubbs wrote:
> Hi
> I have been building newlib (successfully) for sometime now by creating a
> soft link from the gcc sources to the newlib source directory.
> The problem with this is that every time I do anything do gcc the build
> system has to go through all of newlib (including the many multilibs) and
> whenever I do anything to newlib the build system has to go through all of
> gcc.
> This is not the most satisfactory situation so I am wondering if it is
> possible to split them up somehow.
> Is it possible to build gcc without newlib being present, but such that it
> would use newlib if I were to install it in the same place?

IIRC, you can configure with: --with-newlib and --with-headers=xxx where xxx
is your newlib-src-path/libc/include.  This will cause gcc to use the newlib
headers when building it's target library and will allow gcc to specify 
-Dinhibit_libc when building libgcc2.a.  You might want to confirm with the 
gcc folks though.

> Is it possible to build newlib using an existing cross compiler rather
> than build it at the same time as the cross compiler?

Yes.  You simply put the installed cross tools in your path or else override the
xx_FOR_TARGET variables on the make.  Note that unless you install in the
same install directory as gcc does, gcc won't be able to automatically link in your multilibs 
for you when it compiles/links with multilib options specified.  

-- Jeff J.

> ------------------------------------------------------------------------
> |  Andrew Stubbs,                   |  E-mail:    |
> |  STMicroelectronics Ltd.,         |  or  |
> |  1000 Aztec West,                 |                                  |
> |  Almondsbury,                     |  Tel:    +44 (0)1454 462325      |
> |  Bristol, BS32 4SQ, U.K.          |  Fax:    +44 (0)1454 617910      |
> ------------------------------------------------------------------------

More information about the Newlib mailing list