couldn't build cross newlib, please help

J. Johnston
Tue Feb 27 04:10:00 GMT 2001

Tian Ling wrote:
> Hello,
> I was trying to build cross complier on my linux host. I built cross binutils and cross gcc, and I guess they worked because I was able to do a "TARGET-gcc -c".
> However, it seems that I just couldn't build newlib for my target. Following are some details:
> 0. Directories:
> newlib-1.9.0/ build-newlib/
> 1. Variables:
> target=sparc-sun-sunos4.1.1
> prefix=/usr/local
> 2. Actions:
> # cd build-newlib
> # ../newlib-1.9.0/configure --target=$target --prefix=$prefix -v
> # make all install
> 3. Messages:
> 3.1. After "configure":
> Configuring for a i586-pc-linux-gnu host.
> *** This configuration is not supported in the following subdirectories:
> target-newlib target-libgloss
> (Any other directories should still work fine.)
> Created "Makefile" in /root/install/GNU/build-newlib
> Configuring texinfo...
> No configuration information in texinfo
> Configuring etc...
> creating cache ../config.cache
> checking for a BSD compatible install... /usr/bin/install -c
> updating cache ../config.cache
> creating ./config.status
> creating Makefile
> 3.2 After "make"
> make[1]: Entering directory `/root/install/GNU/build-newlib/etc'
> make[1]: Nothing to be done for `all'.
> make[1]: Leaving directory `/root/install/GNU/build-newlib/etc'
> /bin/sh ../newlib-1.9.0/mkinstalldirs /usr/local /usr/local
> make[1]: Entering directory `/root/install/GNU/build-newlib/etc'
> make[1]: Nothing to be done for `install'.
> make[1]: Leaving directory `/root/install/GNU/build-newlib/etc'
> I have looked at the generated Makefile in build-newlib/etc. There is indeed not too many things in there for the make to do. I am confused. It looks to me like I didn't do the configure right. But what could be wrong? I am trying a new target to see what will happen.
> Your help and time will be great appreciated! Thanks.


  The problem is that there is a restriction in the top level that prevents building
target-newlib and target-libgloss for sparc-*-sunos4* (it adds them to the noconfigdirs list). 
There is code in newlib to handle the configuration but it likely hasn't been tested because of the
top level restriction which has been in place since 1996.  To get around the problem, I would advise
you to delete your build tree and either reconfigure with --with-newlib added as a configuration
option or else apply the patch I am attaching and then reconfigure.

-- Jeff J.

More information about the Newlib mailing list