Is a there general method to segregate debugging symbols in Slackware packages?

User Name

Remember Me?

Password

SlackwareThis Forum is for the discussion of Slackware Linux.

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

Is a there general method to segregate debugging symbols in Slackware packages?

I'm needing to know if there is a standard method for creating debug packages in Slackware. If there is, would someone please post the code here on how to do it for all packages. I want to be able to create debug packages for every package I build. I'm particularly interested in a means to replace the strip function that is commonly used in SlackBuilds.

I'm only interested in what to do AFTER the debugging symbols have been created in the main package. I want to know the best means to move them from the main package, to a separate package, $NAME-debug-$VERSION-$ARCH-$BUILD.tgz.

This will leave the symbolic debugging information in the file called basename.dbg and create an executable basename which has no debugging information. The same techniques or an alias could be supplied to make the script run for a slackbuild.

#!/bin/sh
program="$1"
## I think this line below is already taken care in building Slackware packages.
gcc -g "$program.c" -o "$program"
## These are the two following lines which I think are actually helpful.
strip "$program" --only-keep-debug -o "$program".dbg
strip $program

This will leave the symbolic debugging information in the file called basename.dbg and create an executable basename which has no debugging information.
## ^^ I think this is what I was asking for. But see my questions below for clarification. ^^
The same techniques or an alias could be supplied to make the script run for a slackbuild.

What I want is two files (packages). One would be ${name}, and the second would be ${name}-debug. I want to create my main package in /tmp/package-${name}, and then move (mv) all of the symbols to the separate package tree in /tmp/package-${name}-debug.
While ensuring that the files are in a package format that could be properly used. Essentially, I want to copy the way things are done with Redhat/Fedora debug packages.

I'm not certain how to do this in a SlackBuild, since typically, gcc is not called directly. Is there a "make -g" that will achieve the same thing? Typically in SlackBuilds, you have to strip the symbols AFTER they are created. These are the lines of code that are used for this:

This was taken from glibc.SlackBuild:
# The prevailing standard seems to be putting unstripped libraries in
# /usr/lib/debug/ and stripping the debugging symbols from all the other
# libraries.
mkdir -p $PKG/usr/lib${LIBSUFFIX}/debug
cp -a $PKG/lib${LIBSUFFIX}/l*.so* $PKG/usr/lib${LIBSUFFIX}/debug
cp -a $PKG/usr/lib${LIBSUFFIX}/*.a $PKG/usr/lib${LIBSUFFIX}/debug
# Don't need debug+profile:
( cd $PKG/usr/lib${LIBSUFFIX}/debug ; rm -f *_p.* )
# NOTE: Is there really a reason for the glibc-debug package?
# If you're debugging glibc, you can also compile it, right?

## COMMENTED OUT: There's no reason for profile libs to include -g information.
## Put back unstripped profiling libraries:
#mv $PKG/usr/lib/debug/*_p.a $PKG/usr/lib
# It might be best to put the unstripped and profiling libraries in glibc-debug and glibc-profile.