This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Re: Crosscompiling native compiler


On Fri, 31 Dec 1999, Andy wrote:

> There's a directory under  your gcc2.7.2.3/gcc/config that should have the
> name of your target architecture.
> You need to have the .h , t- and  x- files for the OS and processor for
> which you're building  the cross-compiler
The directory is named gcc2.7.2.3/config and of course the files exists because
the configure-scripts detects them and merged the right ones.

> Another thing I ran into :
> You need to either tell gcc where to look for the standard libs and headers
> for your target or ro build them yourself.
These things I had to do when I build the crosscompiler. Building the cross-
compiler didn't make so many trouble like "cross-native-compiling".
(Still don't know the right term. :-)

> In my case (ppowerpc-openbsd ona i386 openbsd ) I downloaded the powerpc
> distribution and ran configure with the following options;
> ... --with-headers=/path_to_target_headers --
> with-libs=/path_to_target_std_libs
> THis causes  it to copy the libs  into <your_install_dir>/<your_arch>/lib
> and the headers into <your_install_dir>/<your_arch>/sys-includes
Yes, these files are in these places after building the crosscompiler.

> BTW, before you can build gcc you have to build binutils.
Er... maybe you misunderstood me!
As I mentioned I had "successfully set up a cross-compiler i386->m68k"!
I don't want to build a crosscompiler i386->m68k (I have it already!),
I want to build a *native* m68k-compiler on a i386-system.

> the configure commands you pass to it should  match the onse you pass to gcc
> 
> As for  RTFM  look for it in the to gcc directory eithther under install or
> INSTALL
I never heard of that file! ;-)

INSTALL, the Crossgcc-FAQ and all other docs *I* know don't cover trouble on
crosscompiling a native compiler. The docs mostly describe how to build a
crosscompiler.

IMHO there's something I didn't find/read in the docs, but I read it some
times. Maybe I have tomatoes on my eyes (we say in Germany). ;-)

Here's a list of simple commands like I used to crosscompile the native
compiler (without prefix etc.):

cd binutils
make distclean
./configure --target=m68k-unknown-linux
make
make install
cd ../gcc-2.7.2.3/
make distclean
./configure --with-gnu-ld --with-gnu-as --host=m68k-unknown-linux m68k-unknown-linux # output will be "Links are now set up to build a native compiler for m68k-unknown-linux"
make LANGUAGES=c # will fail on a xgcc-command, because as doesn't know Motorola-Assembler
echo $PATH # output will be "/bin:/usr/bin"
export PATH="/usr/local/m68k-unknown-linux/bin/:/bin:/usr/bin"
make distclean
./configure --with-gnu-ld --with-gnu-as --host=m68k-unknown-linux m68k-unknown-linux
make LANGUAGES=c # will fail on an *early* cc-command, because as (m68k) doesn't know i386-Assembler
make distclean
./configure --with-gnu-ld --with-gnu-as --host=m68k-unknown-linux m68k-unknown-linux
export PATH="/bin:/usr/bin"
make LANGUAGES=c # will fail again on a xgcc-command
export PATH="/usr/local/m68k-unknown-linux/bin/:/bin:/usr/bin"
make LANGUAGES=c # xgcc-command calls m68k-as, will later fail on "./xgcc -B./  -DIN_GCC    -I./include  enquire.o -o enquire"

Any suggestions?


Frank


> >I'm new to this list.
> >I had successfully set up a cross-compiler i386->m68k, but now I have a
> >problem I didn't find anything about in the (to me known) docs.
> >
> >I want to cross-compile a native compiler (is "cross-compiling" still the
> >right term?):
> >
> >build:  i386-unknown-linux
> >host:   m68k-unknown-linux
> >target: m68k-unknown-linux
> >gcc-version: 2.7.2.3
> >
> >It's the old gcc because the target is a small system and the gcc should
> >compile 2.0.x kernels without patches.
> >The only needed language is "C".
> >
> >"Configure" runs ok saying "Links are now set up to build a native
> >compiler for m68k-unknown-linux", but "make" stops early with "File format
> >not recognized" (object file was compiled as "ELF Motorola 68000").
> >
> >My questions are:
> >Where is the "M" for RTFM? :-)
> >Er... where are the docs?
> >Which binutils-package is recommended?


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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