can newlib be compiled as dynamic lib?

J. Johnston
Fri Apr 5 15:22:00 GMT 2002

Li Chengyuan wrote:
> I only found libc.a in the lib/ directory.
> Why not How can I compile the newlib as dynamic lib?
> --
> --Îȶ¨¿É¿¿µÄÃâ·Ñµç×ÓÐÃ
Ïä  ÓïÒôÓʼþ  Òƶ¯ÊéÇ©  ÈÕÀú·þÎñ  ÍøÂç´æ´¢...ÒÚÓÊδ¾¡

Currently, a .so shared library is only built for x86 linux when built on x86 linux
and we use libtool to do this.  Unfortunately, libtool makes a
number of tests when it configures including some execution tests so we can't
simply extend this work to the generic cross-platform case.  The execution tests
require a library to link with and you will have not built newlib yet;
it's kind of a chicken and egg problem.  We could conceivably extend the current
libtool builds to handle various build = target scenarios.  What particular
configuration are you targetting?

As to why there aren't dynamic libraries, you have to understand the history of
newlib.  Newlib was designed for targetting embedded platforms where memory is often
restrictive and there is usually only a single executable running.  A static
library is necessary.  Cygwin is a special case: they have been using the newlib
libraries to build their dll.  For native platforms, the emphasis has been 
to use glibc which provides dynamic libraries and full functionality for native 

-- Jeff J.

More information about the Newlib mailing list