Project build error: DWARF error: invalid or unhandled FORM value: 0x23

Hi,
I am trying to build a small project which was based upon llvm-project.
For the first time the build was successful, but later after I decided to do a clean rebuild by making a new build directory under the project, I kept getting DWARF errors.

/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x23

I guess it is related with DW_FORM_rnglistx, but due to the limitation of my knowledge, I am not sure how to do to get over this problem.
Could you let me know what can I do to this?

Many thanks!

Hi @JITmlir

The linker you’re using probably doesn’t support DWARF 5 features. Try using a more recent version or another linker (e.g. LLD with compiler flag -fuse-ld=lld) or use a lower DWARF standard (compiler flag -gdwarf-4).

Hi OCHyams,
Thank you for the suggestion! will try it to see.