Skip to content

Instantly share code, notes, and snippets.

@AnyKeyShik
Last active December 22, 2023 10:12
Show Gist options
  • Save AnyKeyShik/ceb184611b379e0686a68f19cecceafe to your computer and use it in GitHub Desktop.
Save AnyKeyShik/ceb184611b379e0686a68f19cecceafe to your computer and use it in GitHub Desktop.
Install glibc debug symbols on Arch Linux
#!/bin/sh
#####################################################
# Install glibc with debug symbols on Arch Linux #
# #
# Make by AnyKeyShik Rarity (c) 2021 #
#####################################################
echo "Installing build dependencies"
# Install Dependencies
sudo pacman -S git svn gd lib32-gcc-libs patch make bison fakeroot devtools
echo "Checkout glibc sources from ArchLinux SVN"
# Checkout glibc source
svn checkout --depth=empty svn://svn.archlinux.org/packages && cd packages
svn update glibc && cd glibc/repos/core-x86_64
echo "Get user locales"
# Add current locale to locale.gen.txt
grep -v "#" /etc/locale.gen >> locale.gen.txt
echo "Change build config to debug"
# Enable debug build in PKGBUILD
sed -i 's#!strip#debug#' PKGBUILD
echo "Build libc"
# Build glibc and glibc-debug packages
makepkg --skipchecksums --config /usr/share/devtools/makepkg-x86_64.conf
echo "Installing libc"
# Install glibc-debug
sudo pacman -U *.pkg.tar.zst
echo "Update makepkg.conf"
sudo sed '/^OPTIONS/ s/!debug/debug/g; /^OPTIONS/ s/strip/!strip/g' /etc/makepkg.conf
echo "Installation complete!"
@TTimo
Copy link

TTimo commented Nov 30, 2023

Note the sed line to edit PKGBUILD doesn't work anymore, see https://wiki.archlinux.org/title/Debugging/Getting_traces#glibc and manually add debug !strip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment