powerpc-linux cross-compiler, limits.h
Kai Ruottu
karuottu@freenet.hut.fi
Fri Jun 4 09:49:00 GMT 1999
Brendan Simon wrote:
> > 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 './xgcc -print-search-dirs', when run in the build dir, will tell the
suitable install directories...
Or just calculating which are the '<prefix>/<target>/include' and
'<prefix>/<target>/lib' after running 'configure' with the '--prefix=...' and
'--target=....'.
If you didn't use the '--prefix', the default for <prefix> is '/usr/local'.
If you did use '--prefix=/usr/local/egcs' and '--target=powerpc-linux', the
suggested install dirs for 'include' and 'lib' will be under
'/usr/local/egcs/powerpc-linux/', just where the binutils are in the 'bin'
subdir...
> 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.
The 'linux' subdir is a symlink from the includes of the current Linux-kernel
sources, which one normally has in '/usr/src/linux/include/linux'... When you
will build a Linux/PowerPC-kernel, the symlink must be set to the right
sources, but meanwhile just symlinking it to the current Linux sources you have
is enough... The 'include/asm' subdir must be a symlink to the 'asm-powerpc'
(or something) in the Linux-kernel sources, not to the 'asm-i386'...
> > 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.
The 'ld.so.1' may be a script, where the '/lib/libc.so' or '/lib/libc.a' is
named. Just edit it...
Using the '-Wl,-verbose' in CFLAGS (make CFLAGS="-v -Wl,-verbose -O") will
enable you to see all the tries and succeedings during linking.
> I edited the specs file '/usr/local/egcs/gcc-lib/egcs-x.xx.xx/specs'. Is this the
> right one ?
Yes.
> 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 ?
The mips-linux and m68k-linux 'dynamic-linker' files are text scripts,
probably the powerpc-linux too... If it is, just edit it... Otherwise there is
a real problem to be solved ;-(
Regards, Kai
_______________________________________________
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.
More information about the crossgcc
mailing list