Skip to contentSkip to conversation

CLANG LTO compatibility issue with DEBUG_INFO_BTF

DISCUSSION Jisheng Zhang 2 participants 3 messages Mar 19, 2021 – Mar 22, 2021 BPF

lore
Share & tools
lore
#0 lore raw

Hi,

When trying the latest 5.12-rc3 with both LTO_CLANG_THIN and DEBUG_INFO_BTF enabled, I met lots of warnings such as:

...
tag__recode_dwarf_type: couldn't find 0x4a7ade5 type for 0x4ab9f88 (subroutine_type)!
ftype__recode_dwarf_types: couldn't find 0x4a7ade5 type for 0x4ab9fa4 (formal_parameter)!
...
namespace__recode_dwarf_types: couldn't find 0x4a8ff4a type for 0x4aba05c (member)! namespace__recode_dwarf_types: couldn't find 0x4a7ae9b type for 0x4aba084 (member)!
...
WARN: multiple IDs found for 'path': 281, 729994 - using 281
WARN: multiple IDs found for 'task_struct': 421, 730101 - using 421
...

then finally get build error:
FAILED unresolved symbol vfs_truncate

Is this a known issue? Do we need to make DEBUG_INFO_BTF depend on !LTO?

pahole version: v1.20
clang version: 11.0

Thanks

#1 lore raw
Quoted 17 lines · Jisheng Zhang

Hi,

When trying the latest 5.12-rc3 with both LTO_CLANG_THIN and DEBUG_INFO_BTF enabled, I met lots of warnings such as:

...
tag__recode_dwarf_type: couldn't find 0x4a7ade5 type for 0x4ab9f88 (subroutine_type)!
ftype__recode_dwarf_types: couldn't find 0x4a7ade5 type for 0x4ab9fa4 (formal_parameter)!
...
namespace__recode_dwarf_types: couldn't find 0x4a8ff4a type for 0x4aba05c (member)! namespace__recode_dwarf_types: couldn't find 0x4a7ae9b type for 0x4aba084 (member)!
...
WARN: multiple IDs found for 'path': 281, 729994 - using 281
WARN: multiple IDs found for 'task_struct': 421, 730101 - using 421
...

Quoted 5 lines

then finally get build error:
FAILED unresolved symbol vfs_truncate

Is this a known issue? Do we need to make DEBUG_INFO_BTF depend on !LTO?

This is a known issue for pahole. pahole does not handle dwarf well generated with LTO. Bill Wendling from google is looking at the issue and I will help look at the issue as well. Since bpf heavily depends on BTF, at this point, I suggest if you are using bpf, please do not
turn on LTO. Or if you build with LTO, just turn off DEBUG_INFO_BTF
in your config. Thanks!

Quoted 7 lines

pahole version: v1.20
clang version: 11.0

Thanks

#2 lore raw
Quoted 23 lines · On Thu, 18 Mar 2021 20:56:46 -0700 Yonghong Song wrote:
Quoted 21 lines · Jisheng Zhang

Hi,

When trying the latest 5.12-rc3 with both LTO_CLANG_THIN and DEBUG_INFO_BTF enabled, I met lots of warnings such as:

...
tag__recode_dwarf_type: couldn't find 0x4a7ade5 type for 0x4ab9f88 (subroutine_type)!
ftype__recode_dwarf_types: couldn't find 0x4a7ade5 type for 0x4ab9fa4 (formal_parameter)!
...
namespace__recode_dwarf_types: couldn't find 0x4a8ff4a type for 0x4aba05c (member)! namespace__recode_dwarf_types: couldn't find 0x4a7ae9b type for 0x4aba084 (member)!
...
WARN: multiple IDs found for 'path': 281, 729994 - using 281
WARN: multiple IDs found for 'task_struct': 421, 730101 - using 421
...

then finally get build error:
FAILED unresolved symbol vfs_truncate

Quoted 9 lines
Quoted 1 line

Is this a known issue? Do we need to make DEBUG_INFO_BTF depend on !LTO?

This is a known issue for pahole. pahole does not handle dwarf well generated with LTO. Bill Wendling from google is looking at the issue and I will help look at the issue as well. Since bpf heavily depends on BTF, at this point, I suggest if you are using bpf, please do not turn on LTO. Or if you build with LTO, just turn off DEBUG_INFO_BTF in your config. Thanks!

Got it. Thanks for the information