Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save steakunderscore/1039852 to your computer and use it in GitHub Desktop.

Select an option

Save steakunderscore/1039852 to your computer and use it in GitHub Desktop.

Revisions

  1. steakunderscore renamed this gist Jun 22, 2011. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion arm-elf-gcc_on_osx.markdown → arm-elf-gcc_on_osx.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    brew install
    #!/bin/bash


    mkdir toolchain
    cd toolchain

  2. steakunderscore revised this gist Jun 22, 2011. 1 changed file with 57 additions and 74 deletions.
    131 changes: 57 additions & 74 deletions arm-elf-gcc_on_osx.markdown
    Original file line number Diff line number Diff line change
    @@ -1,85 +1,68 @@
    Install some needed libraries
    brew install
    mkdir toolchain
    cd toolchain

    brew install libmpc

    Make the temp directory to build in
    wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz
    wget http://ftp.gnu.org/gnu/gdb/gdb-7.2.tar.gz
    wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
    wget http://ftp.gnu.org/gnu/gcc/gcc-4.6.0/gcc-core-4.6.0.tar.bz2
    wget http://ftp.gnu.org/gnu/gcc/gcc-4.6.0/gcc-g++-4.6.0.tar.bz2

    mkdir toolchain
    cd toolchain

    Get the required sources
    extract binutils-2.21.tar.bz2
    extract gcc-core-4.6.0.tar.bz2
    extract newlib-1.19.0.tar.gz
    extract gdb-7.2.tar.gz
    extract gcc-g++-4.6.0.tar.bz2

    wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz
    wget http://ftp.gnu.org/gnu/gdb/gdb-7.2.tar.gz
    wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
    wget http://ftp.gnu.org/gnu/gcc/gcc-4.6.0/gcc-core-4.6.0.tar.bz2
    wget http://ftp.gnu.org/gnu/gcc/gcc-4.6.0/gcc-g++-4.6.0.tar.bz2

    extract binutils-2.21.tar.bz2
    extract gcc-core-4.6.0.tar.bz2
    extract newlib-1.19.0.tar.gz
    extract gdb-7.2.tar.gz
    extract gcc-g++-4.6.0.tar.bz2

    Set up the required variables

    export target=arm-elf
    export prefix=/usr/local/$target
    export PATH=$prefix/bin:$PATH

    Create the bin folder for the final binaries
    export target=arm-elf
    export prefix=/usr/local/$target
    export PATH=$prefix/bin:$PATH

    mkdir -p $prefix/bin

    Build binutils

    cd binutils-2.21
    mkdir build-$target
    cd build-$target
    ../configure --target=$target --prefix=$prefix --enable-interwork --enable-multilib \
    --disable-nls --disable-shared --disable-threads --with-gcc --with-gnu-as --with-gnu-ld
    make
    make install

    Build the temporary gcc to build newlib with. Make sure the `--with-headers` line references the version of newlib you downloaded
    mkdir -p $prefix/bin

    cd ../../gcc-4.6.0
    mkdir build-$target
    cd build-$target
    ../configure --target=$target --prefix=$prefix \
    --disable-nls --disable-shared --disable-threads \
    --with-gcc --with-gnu-ld --with-gnu-as --with-dwarf2 \
    --enable-languages=c,c++ --enable-interwork \
    --enable-multilib --with-newlib \
    --with-headers=../../newlib-1.19.0/newlib/libc/include \
    --disable-libssp --disable-libstdcxx-pch \
    --disable-libmudflap --disable-libgomp -v
    mkdir -p libiberty libcpp fixincludes
    make all-gcc
    make install-gcc

    Build newlib

    cd ../../newlib-1.19.0
    mkdir build-$target
    cd build-$target
    ../configure --target=$target --prefix=$prefix --enable-interwork --enable-multilib
    make
    make install

    Build the final gcc
    cd binutils-2.21
    mkdir build-$target
    cd build-$target
    ../configure --target=$target --prefix=$prefix --enable-interwork --enable-multilib \
    --disable-nls --disable-shared --disable-threads --with-gcc --with-gnu-as --with-gnu-ld
    make
    make install

    cd ../../gcc-4.6.0/build-$target
    make
    make install

    Build gdb

    cd ../../gdb-7.2
    mkdir build-$target
    cd build-$target
    ../configure --target=$target --prefix=$prefix --disable-nls
    make
    make install
    cd ../../gcc-4.6.0
    mkdir build-$target
    cd build-$target
    ../configure --target=$target --prefix=$prefix \
    --disable-nls --disable-shared --disable-threads \
    --with-gcc --with-gnu-ld --with-gnu-as --with-dwarf2 \
    --enable-languages=c,c++ --enable-interwork \
    --enable-multilib --with-newlib \
    --with-headers=../../newlib-1.19.0/newlib/libc/include \
    --disable-libssp --disable-libstdcxx-pch \
    --disable-libmudflap --disable-libgomp -v
    mkdir -p libiberty libcpp fixincludes
    make all-gcc
    make install-gcc

    Blatantly stolen from [the Ethernut Project](http://www.ethernut.de/en/documents/cross-toolchain-osx.html), just documenting my experience with it on a 10.6 Macbook Air with the newest versions of each tool.
    cd ../../newlib-1.19.0
    mkdir build-$target
    cd build-$target
    ../configure --target=$target --prefix=$prefix --enable-interwork --enable-multilib
    make
    make install


    cd ../../gcc-4.6.0/build-$target
    make
    make install


    cd ../../gdb-7.2
    mkdir build-$target
    cd build-$target
    ../configure --target=$target --prefix=$prefix --disable-nls
    make
    make install
  3. @Nemo157 Nemo157 revised this gist Jun 22, 2011. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions arm-elf-gcc_on_osx.markdown
    Original file line number Diff line number Diff line change
    @@ -34,6 +34,8 @@ Create the bin folder for the final binaries
    Build binutils

    cd binutils-2.21
    mkdir build-$target
    cd build-$target
    ../configure --target=$target --prefix=$prefix --enable-interwork --enable-multilib \
    --disable-nls --disable-shared --disable-threads --with-gcc --with-gnu-as --with-gnu-ld
    make
  4. @Nemo157 Nemo157 revised this gist Jun 22, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion arm-elf-gcc_on_osx.markdown
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ Get the required sources

    extract binutils-2.21.tar.bz2
    extract gcc-core-4.6.0.tar.bz2
    extract newlib-1.19.0.tar.gz gcc-g++-4.6.0.tar.bz2 gdb-7.2.tar.gz
    extract newlib-1.19.0.tar.gz
    extract gdb-7.2.tar.gz
    extract gcc-g++-4.6.0.tar.bz2

  5. @Nemo157 Nemo157 revised this gist Apr 7, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion arm-elf-gcc_on_osx.markdown
    Original file line number Diff line number Diff line change
    @@ -80,4 +80,4 @@ Build gdb
    make
    make install

    Blatantly stolen from [http://www.ethernut.de/en/documents/cross-toolchain-osx.html], just documenting my experience with it on a 10.6 Macbook Air with the newest versions of each tool.
    Blatantly stolen from [the Ethernut Project](http://www.ethernut.de/en/documents/cross-toolchain-osx.html), just documenting my experience with it on a 10.6 Macbook Air with the newest versions of each tool.
  6. @Nemo157 Nemo157 revised this gist Apr 7, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion arm-elf-gcc_on_osx.markdown
    Original file line number Diff line number Diff line change
    @@ -80,4 +80,4 @@ Build gdb
    make
    make install

    Blatantly stolen from http://www.ethernut.de/en/documents/cross-toolchain-osx.html, just documenting my experience with it on a 10.6 Macbook Air with the newest versions of each tool.
    Blatantly stolen from [http://www.ethernut.de/en/documents/cross-toolchain-osx.html], just documenting my experience with it on a 10.6 Macbook Air with the newest versions of each tool.
  7. @Nemo157 Nemo157 revised this gist Apr 7, 2011. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions arm-elf-gcc_on_osx.markdown
    Original file line number Diff line number Diff line change
    @@ -79,3 +79,5 @@ Build gdb
    ../configure --target=$target --prefix=$prefix --disable-nls
    make
    make install

    Blatantly stolen from http://www.ethernut.de/en/documents/cross-toolchain-osx.html, just documenting my experience with it on a 10.6 Macbook Air with the newest versions of each tool.
  8. @Nemo157 Nemo157 revised this gist Apr 7, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions arm-elf-gcc_on_osx.markdown
    Original file line number Diff line number Diff line change
    @@ -39,7 +39,7 @@ Build binutils
    make
    make install

    Build the temporary gcc to build newlib with
    Build the temporary gcc to build newlib with. Make sure the `--with-headers` line references the version of newlib you downloaded

    cd ../../gcc-4.6.0
    mkdir build-$target
    @@ -49,7 +49,7 @@ Build the temporary gcc to build newlib with
    --with-gcc --with-gnu-ld --with-gnu-as --with-dwarf2 \
    --enable-languages=c,c++ --enable-interwork \
    --enable-multilib --with-newlib \
    --with-headers=../../newlib-1.19.0/newlib/libc/include \ # Make sure this is the version you downloaded
    --with-headers=../../newlib-1.19.0/newlib/libc/include \
    --disable-libssp --disable-libstdcxx-pch \
    --disable-libmudflap --disable-libgomp -v
    mkdir -p libiberty libcpp fixincludes
  9. @Nemo157 Nemo157 revised this gist Apr 7, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion arm-elf-gcc_on_osx.markdown
    Original file line number Diff line number Diff line change
    @@ -49,7 +49,7 @@ Build the temporary gcc to build newlib with
    --with-gcc --with-gnu-ld --with-gnu-as --with-dwarf2 \
    --enable-languages=c,c++ --enable-interwork \
    --enable-multilib --with-newlib \
    --with-headers=../../newlib-1.19.0/newlib/libc/include \
    --with-headers=../../newlib-1.19.0/newlib/libc/include \ # Make sure this is the version you downloaded
    --disable-libssp --disable-libstdcxx-pch \
    --disable-libmudflap --disable-libgomp -v
    mkdir -p libiberty libcpp fixincludes
  10. @Nemo157 Nemo157 created this gist Apr 7, 2011.
    81 changes: 81 additions & 0 deletions arm-elf-gcc_on_osx.markdown
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,81 @@
    Install some needed libraries

    brew install libmpc

    Make the temp directory to build in

    mkdir toolchain
    cd toolchain

    Get the required sources

    wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz
    wget http://ftp.gnu.org/gnu/gdb/gdb-7.2.tar.gz
    wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
    wget http://ftp.gnu.org/gnu/gcc/gcc-4.6.0/gcc-core-4.6.0.tar.bz2
    wget http://ftp.gnu.org/gnu/gcc/gcc-4.6.0/gcc-g++-4.6.0.tar.bz2

    extract binutils-2.21.tar.bz2
    extract gcc-core-4.6.0.tar.bz2
    extract newlib-1.19.0.tar.gz gcc-g++-4.6.0.tar.bz2 gdb-7.2.tar.gz
    extract gdb-7.2.tar.gz
    extract gcc-g++-4.6.0.tar.bz2

    Set up the required variables

    export target=arm-elf
    export prefix=/usr/local/$target
    export PATH=$prefix/bin:$PATH

    Create the bin folder for the final binaries

    mkdir -p $prefix/bin

    Build binutils

    cd binutils-2.21
    ../configure --target=$target --prefix=$prefix --enable-interwork --enable-multilib \
    --disable-nls --disable-shared --disable-threads --with-gcc --with-gnu-as --with-gnu-ld
    make
    make install

    Build the temporary gcc to build newlib with

    cd ../../gcc-4.6.0
    mkdir build-$target
    cd build-$target
    ../configure --target=$target --prefix=$prefix \
    --disable-nls --disable-shared --disable-threads \
    --with-gcc --with-gnu-ld --with-gnu-as --with-dwarf2 \
    --enable-languages=c,c++ --enable-interwork \
    --enable-multilib --with-newlib \
    --with-headers=../../newlib-1.19.0/newlib/libc/include \
    --disable-libssp --disable-libstdcxx-pch \
    --disable-libmudflap --disable-libgomp -v
    mkdir -p libiberty libcpp fixincludes
    make all-gcc
    make install-gcc

    Build newlib

    cd ../../newlib-1.19.0
    mkdir build-$target
    cd build-$target
    ../configure --target=$target --prefix=$prefix --enable-interwork --enable-multilib
    make
    make install

    Build the final gcc

    cd ../../gcc-4.6.0/build-$target
    make
    make install

    Build gdb

    cd ../../gdb-7.2
    mkdir build-$target
    cd build-$target
    ../configure --target=$target --prefix=$prefix --disable-nls
    make
    make install