This is the mail archive of the
crossgcc@cygnus.com
mailing list for the crossgcc project.
Re: egcs-1.1.2 powerpc cross-compiler question.
- To: crossgcc@cygnus.com
- Subject: Re: egcs-1.1.2 powerpc cross-compiler question.
- From: "Kai Ruottu" <karuottu@freenet.hut.fi>
- Date: Wed, 5 May 1999 10:32:50 +0000
- Comments: Authenticated sender is <karuottu@mail.freenet.hut.fi>
- Organization: Freenet Finland
- Reply-To: crossgcc@cygnus.com
Brendan Simon wrote:
> I've tried building egcs-1.1.2 as a powerpc-eabi cross compiler and a
> powerpc-linux cross compiler.
I think that the general rule would be to use newlib for the embedded target,
and use the available pre-built system libraries and headers for the 'system'
targets. Normally only the library binaries are available, but for Linux
also building glibc-2.1 or 2.0.7 or something more new for the
'powerpc-linux-gnu' target later, if the pre-built C-library is 'too old',
is possible...
> I had instructions from the LinuxPPC web site on building the powerpc-linux
> cross compiler. The configure command was "configure --target=powerpc-linux
> --with-newlib".
If this '--with-newlib' means that the Cygnus newlib should be used somehow,
it sounds like pure bullshit... The GNU glibc-2 is the official Linux
C-library after the earlier libc5-releases (were these available for
powerpc-linux at all?)
One site I found for pre-built RPMs for Linux'es is :
http://rufus.w3.org/linux/RPM
but don't remember the version of the available C-library binaries for
powerpc-linux...
> The error message I am getting looks like its related to
> the objective C build which I don't need but I am interested in trying
> it one day. The errors are:
> egcs-1.1.2/gcc/objc/runtime.h:31 stdio.h: No such file or directory
> egcs-1.1.2/gcc/objc/runtime.h:31 ctype.h: No such file or directory
Your cross-compiler didn't find the target headers. If you haven't used any
own '--prefix=...', the normal place for them is :
/usr/local/powerpc-linux/include
I think that it is quite possible to just symlink your current native libc6
Linux headers (if you have RedHat 5.x etc.) at '/usr/include' there --- some
minor differences can be between different glibc-2.0.x-releases, but the 'basic
headers' needed for libobjc.a build should be quite stable and just the same
between releases...
> I did not have these problems building the native linux build of
> egcs-1.1.2. It obviously knows how/where to find the appropriate
> headers.
It's 'cpp' which searches for the headers... Perhaps there is an equivalent
option to the GCC '-print-search-dirs' for 'cpp', but the sure way is to use
the '-v' and look at a logfile after something like :
make > MakeLog 2>&1
and see what 'include' directories 'cpp' searches...
> How can I get the objc build to find the appropriate header files ?
Just install them in the proper place... Please look with the
./xgcc -print-search-dirs
in the '.../egcs-1.1.2/gcc' build directory and see what the last directories
given for 'programs' and 'libraries' are, and install the headers to the
'.../include', parallel to these. The default in your configure-command-case
and target-name could be the '/usr/local/powerpc-linux/include'
My last hint could be to get the powerpc-linux version of 'ld-linux.so.2'
also among the powerpc-linux pre-built libs, and set the '-dynamic-linker' in
'specs' to point to this, equivalent to what I have in my Win32-to-i486-linux
cross-compiler :
*link:
-m elf_i386 %{shared:-shared}
%{!shared: %{!ibcs: %{!static: %{rdynamic:-export-dynamic}
%{!dynamic-linker:-dynamic-linker /usr/local/i486-linux-gnu/lib/ld-linux.so.2
--rpath /usr/local/i486-linux-gnu/lib}} %{static:-static}}}
(all this stuff just in one line after the '*link:')
Of course the 'i486-linux-gnu' must be 'powerpc-linux' etc. in your case, but
the idea is that the 'ld-linux.so.2' is also one of the needed 'libraries'...
If your 'rpm' utility denies to unpack the PowerPC-Linux RPM in the
x86-environment, saying that "you don't need it" or "you have wrong system",
just use the 'rpm2cpio' utility to convert the '.rpm' into a '.cpio' packet:
rpm2cpio the_packet.rpm > the_packet.cpio
and continue with 'cpio', e.g. using 'cpio -iBdmv < the_packet.cpio' in a
temporary directory... Sigh, I really hate these 'smart installers'...
Cheers, 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.