Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save steakunderscore/1039852 to your computer and use it in GitHub Desktop.
Save steakunderscore/1039852 to your computer and use it in GitHub Desktop.
How I installed arm-elf-gcc on Mac OS X
#!/bin/bash
mkdir toolchain
cd toolchain
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
export target=arm-elf
export prefix=/usr/local/$target
export PATH=$prefix/bin:$PATH
mkdir -p $prefix/bin
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
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
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
@Shmadul
Copy link

Shmadul commented Jul 9, 2017

same

@Shmadul
Copy link

Shmadul commented Jul 9, 2017

@ftcX1982
Copy link

ftcX1982 commented Jan 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment