Skip to content

Instantly share code, notes, and snippets.

@cicorias
Forked from ilg-ul/build-arm-none-eabi-gdb.sh
Created September 14, 2022 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cicorias/9ba6b758f2714bef20f564daae35f91a to your computer and use it in GitHub Desktop.
Save cicorias/9ba6b758f2714bef20f564daae35f91a 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