You are not logged in.

#1 Yesterday 10:59:10

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,885

[Solved] How does makepkg create separate debug packages ?

I'm trying to figure out how/what commands makepkg uses to put debug symbols in separate packages .

adding -g flag to a compiler invocation creates debug symbols .
running strip on object files removes the symbols and discards them.

What moves the symbols to separate files ?

Last edited by Lone_Wolf (Today 13:43:06)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#2 Yesterday 11:55:09

5hridhyan
Member
From: Asia
Registered: 2025-12-25
Posts: 501

Re: [Solved] How does makepkg create separate debug packages ?

to my understanding makepkg uses objcopy --only-keep-debug to extract the debug symbols into a separate .debug file (in the -debug package under /usr/lib/debug/...), it then adds a .gnu_debuglink section with objcopy --add-gnu-debuglink so GDB can find it, and finally strips the main binary....

Edit:
handled by makepkg’s strip/tidy stage /strip.sh and is enabled via OPTIONS=(debug).
fixed typo

Last edited by 5hridhyan (Yesterday 12:08:15)


---

Offline

#3 Yesterday 12:00:00

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,405
Website

Re: [Solved] How does makepkg create separate debug packages ?

Check https://gitlab.archlinux.org/pacman/pac … =heads#L77 (and preceding function)

TLDR: objcopy.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 Today 13:42:49

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,885

Re: [Solved] How does makepkg create separate debug packages ?

Thanks 5hridhyan and Wormzy, that clarifies how this works.

Marking as [Solved]


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB