This is the mail archive of the newlib@sourceware.cygnus.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: powerpc-linux cross gcc-2.95 with newlib-1.8.1 missing crt1.o


Graham Stoney wrote:

> I'm attempting to build a powerpc-linux cross-compiler from gcc-2.95 to run on
> a Red Hat 6.0 i686-pc-linux-gnu system, with the binutils-990809 snapshot and
> newlib-1.8.1 as my C library. They're all configured with:
>     --target=powerpc-linux --with-gnu-as --with-gnu-ld --with-newlib

Are you sure that Linux cross-compilers can be built using newlib as the C library.  I don't know of any Linux system that uses
newlib.  All Linux systems I know of use glibc and I suspect that is your problem.
You need to get the runtime libs and headers and preinstall them before building binutils and gcc.  You can get some rpms (see
below) and unpack them into $prefix/$target/include and $prefix/$target/lib.  You also need the linux source header files.


I found one of Kai Ruottu's emails in my files at work.
He gave me the following URLs to look at:
http://www.yellowdoglinux.com/

ftp://rpmfind.net/linux/yellowdog/champion-1.0/ppc/RedHat/RPMS/
- glibc-2.1-1a.ppc.rpm
- glibc-devel-2.1-1a.ppc.rpm

Use rpm and cpio to extract the files into a temporary directory.
$ rpm2cpio glibc-2.1-1a.ppc.rpm > glibc-2.1-1a.ppc.cpio
$ rpm2cpio glibc-devel-2.1-1a.ppc.rpm > glibc-devel-2.1-1a.ppc.cpio
$ cpio -iBdmv < glibc-2.1-1a.ppc.rpm
$ cpio -iBdmv < glibc-devel-2.1-1a.ppc.rpm

After copying all the "lib/..." stuff into "usr/lib" and fixing the
symbolic links in "usr/lib" (those pointing to ../../lib) to point to
the files in the same directory, move the stuff from "usr/lib" and
"usr/include" to $prefix/$target/lib and $prefix/$target/lib
directories.

Probably need to fix the "-dynamic-linker" statement in the specs file
($prefix/lib/gcc-lib/$target/$egcs-version/specs) to be "-dynamic-linker
$prefix/$target/lib/ld.so.1".

Also need to edit $prefix/$target/lib/libc.so.  Change /usr/lib to
$prefix/$target/lib.

I have copied these instructions from a printed email I found (with some
of my notes scribbled on them).



> The build of gcc-2.95 fails while building libio/iogetline.c with:
> ../../../../gcc-2.95/libio/libio.h:30: _G_config.h: No such file or directory
>
> This is problem #1; Any ideas where gcc is supposed to find _G_config.h?
>
> I notice at this point that all the compiler passes are built, so I installed
> gcc-2.95 (despite the above build error), and went ahead and built newlib-1.8.1
> in a spirit of persistance and international understanding.
>
> newlib built and installed fine, but when I go to compile "hello world" with
> the resulting compiler, crt1.o is missing:
> bash$ powerpc-linux-gcc hello.c
> /home/elph/greyham/linux/ppc/tooldir/host/i686-pc-linux-gnu/powerpc-linux/bin/ld: cannot open crt1.o: No such file or directory
> collect2: ld returned 1 exit status
>
> This is problem #2; Where is crt1.o supposed to come from?
> newlib-1.8.1 builds crt0.o, and includes numerous crt1.c's, but no crt1.o
> gets built. Is this a configure problem with newlib, or am I going crazy?
>
> And finally, an off-the-wall question #3 for the newlib crew:
> Is there any plan to add POSIX threads support to newlib?
>
> Thanking you all very muchly,
> Graham


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