This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc 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-compiler, limits.h


Hi Kai and fellow gcc cross-compiler people.  I'm trying to build a powerpc-linux
cross-compiler and followed Kai Ruottu's suggestions.  I have gotten a bit further
and have a few questions/problems which are described below.

Kai Ruottu wrote:

> Please look at:
>    www.yellowdoglinux.com
> for a Linux/PPC release, and
>   ftp://rpmfind.net/linux/yellowdog/champion-1.0/ppc/RedHat/RPMS/
> for the
>
>   glibc-2.1-1a.ppc.rpm  (the runtime shared libs, needed too)
> and
>   glibc-devel-2.1-1a.ppc.rpm (the development headers and libs)
>
> pre-built glibc-2.1 distribution files for Linux/PPC.

Thanks for the pointer to this site.  A good place to find all those RPMS.


> > ie. MUST I copy /usr/include files to /usr/local/egcs/powerpc-linux/include
> > and MUST I copy libraries from another powerpc host ?
>
>  No, ftp'ing the stuff (8.5 M + 8.5 M !!!), and using 'rpm2cpio' + 'cpio' to
> extract the stuff into a temporary dir and its subdirs :
>
>   $ 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.cpio
>   $ cpio -iBdmv < glibc-devel-2.1-1a.ppc.cpio
>
>  After copying all the 'lib/...' stuff into 'usr/lib' and fixing the symlinks
> in 'usr/lib' (those pointing to '../../lib') to point to the files in the same
> directory, all preparing is done, and you can move the stuff from 'usr/lib' and
> 'usr/include' into the final '/usr/local/egcs/powerpc-linux/...' directories.

I did the above and moved 'usr/lib' to '/usr/local/egcs/powerpc-linux/lib' and
'usr/include' to '/usr/local/egcs/powerpc-linux/include'.  Is this right or should
they have been moved to '/usr/local/egcs/powerpc-linux/usr/lib' and
'/usr/local/egcs/powerpc-linux/usr/inlcude' ???

The build process still couln't find 'linux/limits.h'.  The linux symbolic link in
'/usr/local/egcs/powerpc-linux/include' was pointing to '../src/linux' which
didn't exist.  I changed it to point to '../include'.   I guess changing it to '.'
would do the same thing.  I assume this is OK since the build got past this
problem and now has problems checking that xgcc can build executables.  It fails
trying to link the wrong libc (see below).

>  Probably you must fix the '-dynamic-linker /usr/lib/ld.so.1' in 'specs' to be:
> '-dynamic-linker /usr/local/egcs/powerpc-linux/lib/ld.so.1', to get the linking
> to succeed...

I did this too but linking did not work.  The lxgcc command line has '-lc' and the
linker is trying to link in /lib/libc.a.  This does not work ofcourse, since this
file is in Intel x86 format, not powerpc format as needed.  I edited the specs
file '/usr/local/egcs/gcc-lib/egcs-x.xx.xx/specs'.  Is this the right one ?  I
changed the '-dynamic-linker' part as described above but I don't think that
affects the linking of libc.  Any suggestions on how to the the correct libc to be
linked ?


Thanks,
Brendan Simon.


_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

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