Re: Cross g++ for 68332

From: Michael N. Moran (mike_at_mnmoran.org)
Date: 08/04/04


Date: Tue, 03 Aug 2004 21:54:51 -0400

Mogens Dybęk Christensen wrote:
> Thanks, good link! About GCC for embedded Linux, and good links.
>
> But this is for a system running an RTOS without file system or TCP/IP,
> so an m68k-elf-compiler with newlib fits better.
>
> I have mailed with Avi Stuart, who made the kit I first tried
> (http://www.davehylands.com/avi/index.htm). He says it should be
> possible to build C++ applications with his kit.
>

I currently am using:

Binutils: 2.13.2.1

newlib-1.11.0

gcc-3.3

GCC configured as follows:
Configured with: ../gcc-3.3/configure --target=m68k-elf
--prefix=/tools/gnu/gcc/3.3/m68k-elf --with-newlib
--enable-languages=c c++

 From ftp://ftp.gnu.org/gnu (or mirror):

1. Download binutils
3. Download GCC (all relavant C/C++ parts)
3. Download newlib

Here's my m68k-elf build script for binutils. I assume
you've unpacked the binutils sources, created a build
directory "binutils-build" next to the unpacked sources.
Then:

$ cd binutils-build
$ ../m68k-elf-binutils.build

========= m68k-elf-binutils.build ==========
#!/bin/bash

../binutils-2.13.2.1/configure \
    --target=m68k-elf \
    --prefix=/tools/gnu/gcc/3.3/m68k-elf

make CFLAGS="-O2 -fomit-frame-pointer"
make install

===================================

Here's my m68k-elf build script for GCC. I assume
you've unpacked the GCC sources and newlib sources,
created a build directory "build" in the same directory.
Then:

$ cd build
$ export PATH=$PATH:/tools/gnu/gcc/3.3/m68k-elf/bin
$ ../m68k-elf-gcc.build

============= m68k-elf-gcc.build ================
#!/bin/bash

# Note: need to set PATH to point at binutils m68k-elf/bin

rm -f ../gcc-3.3/newlib

ln -s ../../../newlib/1.11.0/newlib-1.11.0/newlib ../gcc-3.3/newlib

BINUTILS_PATH=/tools/gnu/gcc/3.3/m68k-elf/bin

export PATH=$PATH:$BINUTILS_PATH

../gcc-3.3/configure \
         --target=m68k-elf \
         --prefix=/tools/gnu/gcc/3.3/m68k-elf \
         --with-newlib \
         --enable-languages="c c++"

make CFLAGS="-O2 -fomit-frame-pointer" > make.temp 2>&1

make install
===================================================

Of course, you have to have permission to write the
install directory (--prefix) in both installations.

-- 
Michael N. Moran           (h) 770 516 7918
5009 Old Field Ct.         (c) 678 521 5460
Kennesaw, GA, USA 30144    http://mnmoran.org
"... abstractions save us time working, but they don't
  save us time learning."
Joel Spolsky, The Law of Leaky Abstractions
The Beatles were wrong: 1 & 1 & 1 is 1


Relevant Pages

  • Re: Building ruby with bcc32
    ... packages under Devel category. ... make install DESTDIR="anywhere you want install to" ... using gcc without Cygwin. ... You need to install gcc, binutils, ...
    (comp.lang.ruby)
  • Re: FreeBSD/AVR32 port
    ... Attached are instruction how to get binutils, gcc and uboot mkimage for avr32 working on FreeBSD. ... I have no intrest in trying to get the toolchain into the freebsd tree until Atmel has submitted they're changes upstream, and the fact that some Atmel gcc patches seem to break other arch builds. ... $ gmake install ...
    (freebsd-current)
  • Re: possible BinUtils 2.17+ bug (a.out is stubbed, didnt use to be)
    ... Recently it was discovered by CWS and myself that "gcc myfile.c -o ... myfile" produces myfile, myfile.exe as usual. ... And yet, BinUtils 2.16.1 ... it's own linker script which caused binutils not to add stub (search ...
    (comp.os.msdos.djgpp)
  • Re: [BUG] x86 kenel wont boot under Virtual PC
    ... /* We need to decide which NOP sequence to use for 32bit and ... this is a gcc bug. ... Subject: x86: prevent binutils from being "smart" and generating NOPLs for us ...
    (Linux-Kernel)
  • Re: gcc for M16C/M32C
    ... build and install binutils ... build and install newlib. ... build the rest of gcc and install it. ...
    (comp.arch.embedded)