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: Information for cross-compiler with GCC


"Tanausú Ramírez García" wrote:
> 
> >   See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> >
> > I have read this yet, but I dont understand very well, because i'm spanish and i
> > have dificult to understanding.
> >
> > if anybody indicate me the steps slowly that i have to do i'm thankness.

 Fortunately not thankless ;-)

> > My problem is the next:
> >    I have a Pentium II, and i want install the cross compiler for this and how
> > target a MIPS, because i want work in the Nachos Operating System for a work in
> > the University.

 The 'Pentium II' is not essential, but whether you are using
DOS/Win3.1x, Win9x, NT,
Linux, Solaris2, SCO OSR5, SCO UnixWare, FreeBSD, OS/2 or some other
operating system
in your PC, would be... Some of these environments aren't very good
build systems (the
Unix-like systems are the best).

 Nachos needs the 'mips-ultrix4' target for the compiler, i.e. the
binaries will be
produced like the target would be a MIPS-based DECstation with Ultrix...
I have the
Ultrix4 targeted compiler now running under Linux and Win32...

	E:\usr\local\samples>gcc-mips-ultrix4 -v
	Reading specs from e:\usr\local\lib\gcc-lib\mips-ultrix4\2_95.2\specs
	gcc version 2.95.2 19991024 (release)

 There should still be instructions available for producing a
cross-compiler
for Nachos :

------------------ clip --------------------------------------
This README file describes the Nachos release.  Comments, questions, and
bug reports
are always welcome, and can be directed to nachos@cs.berkeley.edu (for
now, an alias
to just me, Tom Anderson), or to the alt.os.nachos newsgroup.

Nachos is instructional software for teaching undergraduate, and
potentially graduate,
level operating systems courses.  The Nachos distribution comes with: 

   an overview paper
   simple baseline code for a working operating system
   a simulator for a generic personal computer/workstation sample
assignments
   a C++ primer (Nachos is written in an easy-to-learn subset of C++, 
     and the primer helps teach C programmers our subset)

<clip>

Building a gcc cross-compiler
-----------------------------
The gcc distribution has fairly good documentation on how to do this,
but since
I walked through it, I figured I would just give you a recipe.  The
following
works from the SPARC to the DEC MIPS; if you want a cross-compiler to a
different
platform (eg, the HP Snakes), you'll need to just alter this procedure
slightly.

NOTE: we don't need the full cross-compiled environment.  In particular,
Nachos
user programs include none of the standard UNIX library or system call
stubs, and
it assumes its own crt.s (assembly language assist for starting a
program running).
This makes this significantly simpler, and it vastly reduces the size of
(and overall
simplifies) the resulting object code.

# To build a cross-compiler using the gnu tools:

# where the executables are to go, usually /usr/local
% setenv gccLocal /usr/local 	

# build gas and binutils first
% cd gas* 

% ./configure --host=sparc-sun-sunos4.1.3 --target=decstation-ultrix
--prefix $gccLocal

% make

% make install

% cd ../bin* 

% ./configure --host=sparc-sun-sunos4.1.3 --target=decstation-ultrix
--prefix $gccLocal

% make

% make install

% cd ../gcc*

% ./configure --host=sparc-sun-sunos4.1.3 --target=decstation-ultrix
--with-gnu-as --with-gnu-ld
 --prefix $gccLocal --local-prefix $gccLocal

# Afer building the cross-compiler, the Makefile is going to try to
# use it to build a set of libraries, and a couple test cases.
# Unfortunately, the libraries depend on UNIX headers (such as stdio.h).
#
# Since Nachos user programs don't need these headers (they'd be
# wrong anyway, since Nachos doesn't support the standard UNIX syscall
# interface), we need to fake out the Makefile.

# create a dummy lib files, to keep make happy 
% ar r libgcc.a /dev/null
% ar r libgcc2.a /dev/null

# Delete the following lines from the Makefile
#     ENQUIRE = enquire
#     CROSS_TEST = cross-test
% vi Makefile

% make LANGUAGES=c

# at this point you may get an error building libgcc2; ignore it and
proceed.

% make install LANGUAGES=c

# at this point, the cross-compiler and subsidiary tools
# are now installed, in $gccLocal/decstation-ultrix/bin

# one last thing --
#   you need to edit nachos/code/test/Makefile to use the
#   gcc cross-compilation tools you have just built, instead of using 
#   normal gcc.
------------------- clip --------------------------------------

 Are you sure there aren't equivalent instructions any more? Or any
prebuilt
binaries for your host -- Perhaps building the cross-compiler is
important
part of your study? Then getting prebuilt ones isn't very good idea --
you
do it and you will learn something... But doing it under DOS/Win3.1x or
Win9x
can be just too much trouble. (Perhaps the prebuilt binaries are then
allowed...)

Cheers, Kai


------
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]