Skip to content

Instantly share code, notes, and snippets.

@vheon
Forked from ilg-ul/build-arm-none-eabi-gdb.sh
Created November 3, 2015 22:18
Show Gist options
  • Save vheon/0123e9ba52e11cc2cd12 to your computer and use it in GitHub Desktop.
Save vheon/0123e9ba52e11cc2cd12 to your computer and use it in GitHub Desktop.
Build the ARM version of GDB on OS X.
#! /bin/bash
set -euo pipefail
IFS=$'\n\t'
GDB_VERSION="7.10"
GDB_BUILD_FOLDER="~/Work/gdb"
mkdir -p "${GDB_BUILD_FOLDER}"
cd "${GDB_BUILD_FOLDER}"
rm -rf "gdb-${GDB_VERSION}"
curl "ftp://ftp.gnu.org/gnu/gdb/gdb-${GDB_VERSION}.tar.xz" | tar -x -v -f -
cd gdb-${GDB_VERSION}
sed -i".bak" "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
# Original
# --with-python=/usr/bin/python2
# Not functional 'configure: error: no usable python found at ...'
# --with-python=/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
./configure \
--target=arm-none-eabi \
--prefix=/usr \
--enable-languages=c,c++ \
--enable-multilib \
--enable-interwork \
--disable-nls \
--with-system-gdbinit=/etc/gdb/gdbinit
make
gdb/gdb --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment