Bug 269928 - ctfconvert errors should be fatal
Summary: ctfconvert errors should be fatal
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-03 02:05 UTC by Mark Johnston
Modified: 2024-02-11 17:28 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Johnston freebsd_committer freebsd_triage 2023-03-03 02:05:39 UTC
ctfconvert has long contained a FreeBSD-specific hack to downgrade various errors into warnings.  CTFv3 has eliminated much of the need for this hack, so it should be revisited since it causes problems when cross-building FreeBSD on MacOS and Linux.

For instance, in a riscv kernel objdir:

markj@nuc> readelf -S exception.o | grep -A1 debug_info
  [ 7] .debug_info       PROGBITS         0000000000000000  00000288
       0000000000000185  0000000000000000           0     0     1
  [ 8] .rela.debug_info  RELA             0000000000000000  00000a80
       00000000000000d8  0000000000000018   I      14     7     8
markj@nuc> ctfconvert -L VERSION -g exception.o 
ERROR: ctfconvert: failed to get offset for die: Invalid argument [dwarf_dieoffset(261)]
markj@nuc> readelf -wi exception.o

Dump of debug contents of section .debug_info:
readelf: could not find DW_TAG_compile_unit die
readelf: could not find DW_TAG_compile_unit die
readelf: could not find DW_TAG_compile_unit die
readelf: could not find DW_TAG_compile_unit die
readelf: could not find DW_TAG_compile_unit die

but binutils readelf can handle it fine, so this is some bug or missing functionality in libdwarf.  Such a problem should cause a build failure.