I have installed clang and lld from source. But, if I build my cmake project with undfined behavior sanitizer flags I got these error messages:
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x23
can be fixed by adding add_compile_options(-gdwarf-4) and
/usr/bin/ld: test.cpp:(.text+0x243): undefined reference to `__ubsan_handle_dynamic_type_cache_miss_abort’
From this messages, I see that clang uses ld.
Is there a way to force clang to use lld and will it fix undefined reference error?