Compile Arch Linux Kernel with Debug Symbols

1k views Asked by At

I'm working on a project that requires me to have debugging symbols for the linux kernel. I'm working on arch linux, and unfortunately, arch doesn't have the kernel debug symbols packaged up nicely like ubuntu does (https://gist.github.com/cantremember/42ec76fdd425a798a8f69b45a8068880).

I figured that I could compile the arch linux kernel with the debug symbols, then pull them out and use them for my purposes. So I downloaded the arch linux kernel (https://git.archlinux.org/linux.git/tag/?h=v5.8.10-arch1); however, I'm having trouble figuring out how to build the kernel with the debug symbols - it isn't apparent how I would do that from the README and Makefile. Could anyone shed some light on this?

1

There are 1 answers

0
SpiderPig1297 On BEST ANSWER

Generally, you need the value CONFIG_DEBUG_INFO=y in the kernel's configuration.

You can either configure it using the graphical menu by running make menuconfig, or by the CLI menu by running make config.

Once configured, run make - j 4 to build the kernel.