Gentoo: Using splitdebug for specific packages

It is often favourable to keep debugging information for certain packages.

Gentoo allows to keep those symbols by adding

CFLAGS="${CFLAGS} -ggdb"
CXXFLAGS="${CXXFLAGS} -ggdb"
FEATURES="${FEATURES} splitdebug"

to your make.conf

But this enables debugging information for all packages. In order to keep debugging symbols only for certain packages, you can define a splitdebug environment in /etc/portage/env/

/etc/portage/env/splitdebug.conf:

CFLAGS="${CFLAGS} -ggdb"
CXXFLAGS="${CXXFLAGS} -ggdb"
FEATURES="${FEATURES} splitdebug"

Now you can add your packages to /etc/portage/package.env:

sys-libs/glibc splitdebug.conf

So when compiling glibc, portage will use the splitdebug environment and keep debugging symbols.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.