public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* CrossGCC build script (including fixes)
@ 2000-10-10  0:52 Enrico Colombini
  2000-10-10  5:28 ` João Cadamuro Junior
  0 siblings, 1 reply; 4+ messages in thread
From: Enrico Colombini @ 2000-10-10  0:52 UTC (permalink / raw)
  To: crossgcc

After gathering information from the CrossGCC FAQ and from this list, I
successfuly built a 68k cross-compiler (the compiler works, but I haven't
tried out the library yet).

Here is the script I used; it is not very elegant and it uses up a lot of
space, but it seems to work fine, both on Linux redHat 6.0 and on CygWin
(CygWin tends to slow down to a trickle on Windows 98, but that is another
problem).

It would be a good idea to delete the "build" subdirectories at the end of
the process (or to modify the script to use a single "build" directory if
space is tight).

  Enrico

--------------

#!/bin/sh

# Build a CrossGCC for newlib for embedded sistems
# Enrico Colombini <erix@mclink.it> October 2000
# It works on my RedHat 6.0 Linux box. I make no other claims. 
#
# Thanks to Scott Howard for the CrossGCC FAQ, to Jo~ao Cadamuro
# and to many people on the CrossGCC list for the fixes, and to
# Marco Morocutti for cooperation and support


# = 1 = Before executing this, get the sources for:
#       binutils, gcc, newlib, gdb
#       and unpack them in the <src> directory (say /home/erix/crossrc)
#       (e.g. tar zxvf binutils-2_10_tar.gz)
#       thus creating four corresponding subdirectories 

# = 2 = Adjust the lines below to configure for your system:
#
prefix=/home/erix/crossgcc # Destination directory
target=m68k-coff # Target system
binutilsdir=binutils-2.10 # Directories created by unpacking sources
gccdir=gcc-2.95.2
newlibdir=newlib-1.8.2
gdbdir=gdb-5.0

# - 3 - Execute this shell script from <src>: ./buildcross

# Create destination directory
mkdir -p $prefix 

# Compile binutils
mkdir -p build$binutilsdir
cd build$binutilsdir
../$binutilsdir/configure --target=$target --prefix=$prefix -v
make all install
cd ..

# Add executables to path, they'll be needed later
PATH=$prefix/bin:$PATH
echo $PATH

# Add symbolic links to newlib into gcc source
cd $gccdir
ln -s ../$newlibdir/newlib newlib
ln -s ../$newlibdir/libgloss libgloss
cd ..

# Compile gcc
mkdir -p build$gccdir
cd build$gccdir
../$gccdir/configure --target=$target --prefix=$prefix --with-newlib
--enable-languages= -v
make all install
cd ..

# Compile newlib
mkdir -p build$newlibdir
cd build$newlibdir
../$newlibdir/configure --target=$target --prefix=$prefix -v
make all install
cd ..

# Compile gdb
mkdir -p build$gdbdir
cd build$gdbdir
../$gdbdir/configure --target=$target --prefix=$prefix -v
make all install
cd ..


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CrossGCC build script (including fixes)
  2000-10-10  0:52 CrossGCC build script (including fixes) Enrico Colombini
@ 2000-10-10  5:28 ` João Cadamuro Junior
  2000-10-11  1:03   ` Enrico Colombini
  0 siblings, 1 reply; 4+ messages in thread
From: João Cadamuro Junior @ 2000-10-10  5:28 UTC (permalink / raw)
  To: Enrico Colombini; +Cc: crossgcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3927 bytes --]

Hello Enrico,


I'd like to add some more tips to the script...

1st) After creating the two symbolic links (newlib and libgloss) in the $gccdir
and build gcc, we don't need to build newlib after. The gcc Makefile will do it
for us. If we use:

# Compile gcc
mkdir -p build$gccdir
cd build$gccdir
../$gccdir/configure --target=$target --prefix=$prefix --with-newlib
--enable-languages= -v
make -w all install 2>&1 | tee make.out
cd ..

The file "make.out" will show us the building of newlib. So, we cannot do it again
after.

2nd) This configuration works only for embedded systems. If someone is trying to
build a cross-compiler for Solaris, for example, this script will not work. The
header files for Solaris isn't provided by newlib. Newlib is intented for embedded
targets only...

3rd) Cygwin is inteted for Windows NT. Running Cygwin under Windows98 could work,
but it is not guaranteed.


If someone has another tip, please give us!!!


João Cadamuro Junior
LIT/CPDTT/CEFET-PR



Enrico Colombini wrote:

> After gathering information from the CrossGCC FAQ and from this list, I
> successfuly built a 68k cross-compiler (the compiler works, but I haven't
> tried out the library yet).
>
> Here is the script I used; it is not very elegant and it uses up a lot of
> space, but it seems to work fine, both on Linux redHat 6.0 and on CygWin
> (CygWin tends to slow down to a trickle on Windows 98, but that is another
> problem).
>
> It would be a good idea to delete the "build" subdirectories at the end of
> the process (or to modify the script to use a single "build" directory if
> space is tight).
>
>   Enrico
>
> --------------
>
> #!/bin/sh
>
> # Build a CrossGCC for newlib for embedded sistems
> # Enrico Colombini <erix@mclink.it> October 2000
> # It works on my RedHat 6.0 Linux box. I make no other claims.
> #
> # Thanks to Scott Howard for the CrossGCC FAQ, to Jo~ao Cadamuro
> # and to many people on the CrossGCC list for the fixes, and to
> # Marco Morocutti for cooperation and support
>
> # = 1 = Before executing this, get the sources for:
> #       binutils, gcc, newlib, gdb
> #       and unpack them in the <src> directory (say /home/erix/crossrc)
> #       (e.g. tar zxvf binutils-2_10_tar.gz)
> #       thus creating four corresponding subdirectories
>
> # = 2 = Adjust the lines below to configure for your system:
> #
> prefix=/home/erix/crossgcc # Destination directory
> target=m68k-coff # Target system
> binutilsdir=binutils-2.10 # Directories created by unpacking sources
> gccdir=gcc-2.95.2
> newlibdir=newlib-1.8.2
> gdbdir=gdb-5.0
>
> # - 3 - Execute this shell script from <src>: ./buildcross
>
> # Create destination directory
> mkdir -p $prefix
>
> # Compile binutils
> mkdir -p build$binutilsdir
> cd build$binutilsdir
> ../$binutilsdir/configure --target=$target --prefix=$prefix -v
> make all install
> cd ..
>
> # Add executables to path, they'll be needed later
> PATH=$prefix/bin:$PATH
> echo $PATH
>
> # Add symbolic links to newlib into gcc source
> cd $gccdir
> ln -s ../$newlibdir/newlib newlib
> ln -s ../$newlibdir/libgloss libgloss
> cd ..
>
> # Compile gcc
> mkdir -p build$gccdir
> cd build$gccdir
> ../$gccdir/configure --target=$target --prefix=$prefix --with-newlib
> --enable-languages= -v
> make all install
> cd ..
>
> # Compile newlib
> mkdir -p build$newlibdir
> cd build$newlibdir
> ../$newlibdir/configure --target=$target --prefix=$prefix -v
> make all install
> cd ..
>
> # Compile gdb
> mkdir -p build$gdbdir
> cd build$gdbdir
> ../$gdbdir/configure --target=$target --prefix=$prefix -v
> make all install
> cd ..
>
> ------
> Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CrossGCC build script (including fixes)
  2000-10-10  5:28 ` João Cadamuro Junior
@ 2000-10-11  1:03   ` Enrico Colombini
  2000-10-11  6:27     ` João Cadamuro Junior
  0 siblings, 1 reply; 4+ messages in thread
From: Enrico Colombini @ 2000-10-11  1:03 UTC (permalink / raw)
  To: João Cadamuro Junior; +Cc: crossgcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]

At 09.34 10/10/00 -0300, João Cadamuro Junior
<cadamuro@lit.cpdtt.cefetpr.br> wrote:

>1st) After creating the two symbolic links (newlib and libgloss)
>in the $gccdir and build gcc, we don't need to build newlib after.
>The gcc Makefile will do it for us.

Thanks for the fix! Do you think something could be broken after
recompiling newlib again (i.e. should I 'make clean' and recompile gcc?).

>This configuration works only for embedded systems.

Yes, I should have put in a note about that.

>Cygwin is inteted for Windows NT. Running Cygwin under Windows98
>could work but it is not guaranteed.

It seems to work... but after compiling gcc and exiting bash I find about
100 mbyte still allocated (and no processes running) and I have to reboot.
I hope the compiled gcc could work fine under Win98 with only the cygwin DLL.

>If someone has another tip, please give us!!!

It would be great to update the script on the CrossGCC FAQ with something
actually working at first try; many people seems to get stuck on the same
problems.

  Enrico


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CrossGCC build script (including fixes)
  2000-10-11  1:03   ` Enrico Colombini
@ 2000-10-11  6:27     ` João Cadamuro Junior
  0 siblings, 0 replies; 4+ messages in thread
From: João Cadamuro Junior @ 2000-10-11  6:27 UTC (permalink / raw)
  To: Enrico Colombini; +Cc: crossgcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 819 bytes --]

> Thanks for the fix! Do you think something could be broken after
> recompiling newlib again (i.e. should I 'make clean' and recompile gcc?).

I think no, because we can modify the libraries at any time and recompile them
without rebuilding the compiler.

Also there are other ways to build a cross-compiler without building the
libraries... but this is another history...


> It would be great to update the script on the CrossGCC FAQ with something
> actually working at first try; many people seems to get stuck on the same
> problems.

I think this is a good idea, but I don't know who can do it....


João Cadamuro Junior
LIT / CPDTT / CEFET-PR


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-10-11  6:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-10  0:52 CrossGCC build script (including fixes) Enrico Colombini
2000-10-10  5:28 ` João Cadamuro Junior
2000-10-11  1:03   ` Enrico Colombini
2000-10-11  6:27     ` João Cadamuro Junior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).