Skip to content

Instantly share code, notes, and snippets.

@palaniraja
Last active October 6, 2026 21:24
Show Gist options
  • Select an option

  • Save palaniraja/1a2a88ee0c18bb3935f3c31e13448bc1 to your computer and use it in GitHub Desktop.

Select an option

Save palaniraja/1a2a88ee0c18bb3935f3c31e13448bc1 to your computer and use it in GitHub Desktop.
gdb build experiments on mac arm64 (script i was testing with gdb-17.1)
#!/bin/sh
# install additional dependencies
#brew install gmp mpfr libmpc texinfo pkg-config
# clean old config
# make distclean
# or force a clean
# rm -f config.cache
# find . -name config.cache -print -exec rm -f {} \;
# make distclean || true
# use a sane make - aarch64
# alias make=/opt/homebrew/bin/gmake
# unalias make
# set environment variables for the build
export AR=/usr/bin/ar
export NM=/usr/bin/nm
export RANLIB=/usr/bin/ranlib
export STRIP=/usr/bin/strip
export CC=clang
export CXX=clang++
export HOMEBREW_PREFIX=/opt/homebrew
export CPPFLAGS="-I${HOMEBREW_PREFIX}/include"
export LDFLAGS="-L${HOMEBREW_PREFIX}/lib"
export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/lib/pkgconfig"
# --host=aarch64-apple-darwin --enable-targets=all \
# x86_64-apple-darwin20
# --target=aarch64-apple-darwin
./configure --prefix=/usr/local/gdb \
--with-gmp=${HOMEBREW_PREFIX}/opt/gmp \
--with-mpfr=${HOMEBREW_PREFIX}/opt/mpfr \
--with-mpc=${HOMEBREW_PREFIX}/opt/libmpc
# make -j$(sysctl -n hw.ncpu) && sudo make -v install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment