Skip to content

Instantly share code, notes, and snippets.

@ilg-ul
Created October 7, 2015 17:53
Show Gist options
  • Save ilg-ul/a02333f31482d0c0a8c7 to your computer and use it in GitHub Desktop.
Save ilg-ul/a02333f31482d0c0a8c7 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