Assembly of foreign architectures (e.g. assembling Sparc shellcode on Mac OS X) requires cross-compiled versions of binutils to be installed. We’ve made this process as smooth as we can.

In these examples, replace $ARCH with your target architecture (e.g., arm, mips64, vax, etc.).

Building binutils from source takes about 60 seconds on a modern 8-core machine.


First, add our Personal Package Archive repository.

$ apt-get install software-properties-common
$ apt-add-repository ppa:pwntools/binutils
$ apt-get update

Then, install the binutils for your architecture.

$ apt-get install binutils-$ARCH-linux-gnu

Mac OS X

Mac OS X is just as easy, but requires building binutils from source. However, we’ve made homebrew recipes to make this a single command. After installing brew, grab the appropriate recipe from our binutils repo.

$ brew install$ARCH.rb

Alternate OSes

If you want to build everything by hand, or don’t use any of the above OSes, binutils is simple to build by hand.

#!/usr/bin/env bash

V=2.25   # Binutils Version
ARCH=arm # Target architecture

cd /tmp
wget -nc$V.tar.gz
wget -nc$V.tar.gz.sig

gpg --keyserver --recv-keys 4AE55E93
gpg --verify binutils-$V.tar.gz.sig

tar xf binutils-$V.tar.gz

mkdir binutils-build
cd binutils-build

export AR=ar
export AS=as

../binutils-$V/configure \
    --prefix=/usr/local \
    --target=$ARCH-unknown-linux-gnu \
    --disable-static \
    --disable-multilib \
    --disable-werror \

hash gmake || MAKE=make

$MAKE -j clean all
sudo $MAKE install