Skip to content

Instantly share code, notes, and snippets.

@yunchih
Last active October 20, 2025 09:17
Show Gist options
  • Save yunchih/882eae15cd344bdb33a0cbd23b6c1f4e to your computer and use it in GitHub Desktop.
Save yunchih/882eae15cd344bdb33a0cbd23b6c1f4e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# build-coreutils-github.sh
# Clone and build GNU coreutils from GitHub with debug symbols.
set -euo pipefail
# Install all dependencies in ONE apt line
sudo apt-get update && sudo apt-get install -y \
autopoint autoconf automake bison gettext git gperf gzip help2man m4 make perl tar texinfo wget xz-utils \
build-essential pkg-config
# Clone repository
git clone https://github.com/coreutils/coreutils.git
cd coreutils
wget https://github.com/coreutils/gnulib/archive/refs/heads/master.zip
unzip master.zip
mv gnulib-master gnulib
# Run bootstrap to generate configure script
./bootstrap --gnulib-srcdir=./gnulib --skip-po
# Configure build with debug info
CFLAGS="-g -O0" FORCE_UNSAFE_CONFIGURE=1 ./configure
# Build using all CPU cores
make -j"$(nproc)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment