Building GCC for Cortex

classic Classic list List threaded Threaded
3 messages Options
Rob Emanuele Rob Emanuele
Reply | Threaded
Open this post in threaded view
|

Building GCC for Cortex

Greetings,

You've put together a nice page for building GCC for the Cortex
processors.  I think I can simplify your build process.
http://eluaproject.dreamhosters.com/en/Building_GCC_for_Cortex

I recently was on a thread about how to build gcc and newlib for
thumb2 (my case was the cortex-m3 processor).
http://gcc.gnu.org/ml/gcc-help/2009-02/msg00000.html

In the end, all that is needed is a simple configuration patch to gcc.
http://gcc.gnu.org/ml/gcc-help/2009-02/msg00033.html

This is using binutils 2.19, gcc 4.3.3, and newlib 1.17.0. (gdb-6.8
too if you wish)

A simple make script like so can be used from the parent directory
containing these tools' source.  Set $(TARGET) to arm-eabi and
$(PREFIX) to where you want it installed.

-- Rob Emanuele

--------- begin make -------------
all: cross-binutils cross-gcc cross-g++ cross-newlib cross-gdb

cross-binutils:
        mkdir -p build/binutils && cd build/binutils && \
        (./config.status || ../../binutils/configure --prefix=$(PREFIX)
--target=$(TARGET)) && \
        $(MAKE) -j$(PROCS)&& \
        $(MAKE) install

cross-gcc: cross-binutils
        mkdir -p build/gcc && cd build/gcc && \
        (./config.status || ../../gcc/configure --prefix=$(PREFIX)
--target=$(TARGET) --enable-languages="c" --with-gnu-ld --with-gnu-as
--with-newlib --disable-libssp) && \
        $(MAKE) && \
        $(MAKE) install

cross-g++: cross-binutils cross-gcc cross-newlib
        mkdir -p build/g++ && cd build/g++ && \
        (./config.status || ../../gcc/configure --prefix=$(PREFIX)
--target=$(TARGET) --enable-languages="c++" --with-gnu-ld
--with-gnu-as --with-newlib --disable-libssp) && \
        $(MAKE) && \
        $(MAKE) install

cross-newlib: cross-binutils cross-gcc
        mkdir -p build/newlib && cd build/newlib && \
        (./config.status || ../../newlib/configure --prefix=$(PREFIX)
--target=$(TARGET) --disable-newlib-supplied-syscalls) && \
        $(MAKE) -j$(PROCS) && \
        $(MAKE) install

cross-gdb:
        mkdir -p build/gdb && cd build/gdb && \
        (./config.status || ../../gdb/configure --prefix=$(PREFIX)
--target=$(TARGET) --disable-werror) && \
        $(MAKE) -j$(PROCS) && \
        $(MAKE) install

------ end make -------

BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Building GCC for Cortex

Thanks, I'll take a closer look when I have some time. It would be really
nice to actually _understand_ the build process, as opposed to using
butt-ugly hacks like mine :)

Best,
Bogdan

On Wed, Feb 4, 2009 at 9:38 PM, Rob Emanuele <poorarm at shoreis.com> wrote:

> Greetings,
>
> You've put together a nice page for building GCC for the Cortex
> processors.  I think I can simplify your build process.
> http://eluaproject.dreamhosters.com/en/Building_GCC_for_Cortex
>
> I recently was on a thread about how to build gcc and newlib for
> thumb2 (my case was the cortex-m3 processor).
> http://gcc.gnu.org/ml/gcc-help/2009-02/msg00000.html
>
> In the end, all that is needed is a simple configuration patch to gcc.
> http://gcc.gnu.org/ml/gcc-help/2009-02/msg00033.html
>
> This is using binutils 2.19, gcc 4.3.3, and newlib 1.17.0. (gdb-6.8
> too if you wish)
>
> A simple make script like so can be used from the parent directory
> containing these tools' source.  Set $(TARGET) to arm-eabi and
> $(PREFIX) to where you want it installed.
>
> -- Rob Emanuele
>
> --------- begin make -------------
> all: cross-binutils cross-gcc cross-g++ cross-newlib cross-gdb
>
> cross-binutils:
>        mkdir -p build/binutils && cd build/binutils && \
>        (./config.status || ../../binutils/configure --prefix=$(PREFIX)
> --target=$(TARGET)) && \
>        $(MAKE) -j$(PROCS)&& \
>        $(MAKE) install
>
> cross-gcc: cross-binutils
>        mkdir -p build/gcc && cd build/gcc && \
>        (./config.status || ../../gcc/configure --prefix=$(PREFIX)
> --target=$(TARGET) --enable-languages="c" --with-gnu-ld --with-gnu-as
> --with-newlib --disable-libssp) && \
>        $(MAKE) && \
>        $(MAKE) install
>
> cross-g++: cross-binutils cross-gcc cross-newlib
>        mkdir -p build/g++ && cd build/g++ && \
>        (./config.status || ../../gcc/configure --prefix=$(PREFIX)
> --target=$(TARGET) --enable-languages="c++" --with-gnu-ld
> --with-gnu-as --with-newlib --disable-libssp) && \
>        $(MAKE) && \
>        $(MAKE) install
>
> cross-newlib: cross-binutils cross-gcc
>        mkdir -p build/newlib && cd build/newlib && \
>        (./config.status || ../../newlib/configure --prefix=$(PREFIX)
> --target=$(TARGET) --disable-newlib-supplied-syscalls) && \
>        $(MAKE) -j$(PROCS) && \
>        $(MAKE) install
>
> cross-gdb:
>        mkdir -p build/gdb && cd build/gdb && \
>        (./config.status || ../../gdb/configure --prefix=$(PREFIX)
> --target=$(TARGET) --disable-werror) && \
>        $(MAKE) -j$(PROCS) && \
>        $(MAKE) install
>
> ------ end make -------
> _______________________________________________
> Elua-dev mailing list
> Elua-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20090205/0479a66b/attachment.html 

Jesus Alvarez Jesus Alvarez
Reply | Threaded
Open this post in threaded view
|

Building GCC for Cortex

In reply to this post by Rob Emanuele
Besides building GCC from sources, devkitARM is an alternative for people
looking for a GNU toolchain to build eLua for ARM targets. devkitARM
primarily targets game consoles (Nintendo DS and GameBoy) but has been used
in many other application areas. Binaries are available for Windows, Linux
and Mac OS X, it is periodically updated and can be freely redistributed. It
works well with the ARM Cortex-M3. The release notes and downloads are at

http://www.devkitpro.org/category/devkitarm/

http://sourceforge.net/project/showfiles.php?group_id=114505&package_id=1242
07

The Lite version of CodeSourcery G++ for ARM is another free GNU toolchain
that can be used to build eLua. It has a larger installed base and is tested
more thoroughly, but the toolchain can't be freely redistributed without an
agreement with CodeSourcery. The downloads are available at

http://www.codesourcery.com/gnu_toolchains/arm/download.html

Regards,
Jesus Alvarez