Skip to content
Commit 10a72c67 authored by Nick Desaulniers's avatar Nick Desaulniers Committed by Greg Kroah-Hartman
Browse files

Makefile: use -gdwarf-{4|5} for assembler for DEBUG_INFO_DWARF{4|5}



This is _not_ an upstream commit and just for 5.15.y only. It is based
on upstream
commit 32ef9e50 ("Makefile.debug: re-enable debug info for .S files").

When the user has chosen not to use their compiler's implicit default
DWARF version (which changes over time) via selecting
- CONFIG_DEBUG_INFO_DWARF4 or
- CONFIG_DEBUG_INFO_DWARF5
we need to tell the compiler this for Asm sources as well as C sources.
(We use the compiler to drive assembler jobs in kbuild, since most asm
needs to be preprocessed first).  Otherwise, we will get object files
built from Asm sources with the compiler's implicit default DWARF
version.

For example, selecting CONFIG_DEBUG_INFO_DWARF4 would produce a DWARFv5
vmlinux, since it was a mix of DWARFv4 object files from C sources and
DWARFv5 object files from Asm sources when using Clang as the assembler
(ex. `make LLVM=1`).

Fixes: 0ee2f056 ("Makefile.debug: re-enable debug info for .S files")
Reported-by: default avatarLecopzer Chen <lecopzer.chen@mediatek.com>
Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6e7bc50f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment