This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Fail if bitcode objects are pulled in after LTO
AbandonedPublic

Authored by sbc100 on Jan 14 2020, 11:36 AM.

Details

Reviewers
None
Summary

This can happen if lto::LTO::getRuntimeLibcallSymbols doesn't return
an complete/accurate list of libcalls. In this case new bitcode
object can be linked in after LTO.

For example the WebAssembly backend currently calls:

setLibcallName(RTLIB::FPROUND_F32_F16, "__truncsfhf2");

But __truncsfhf2 is not part of getRuntimeLibcallSymbols so if
this symbol is generated during LTO the link will currently fail.

Without this change the linker crashes because the bitcode symbol
makes it all the way to the output phase.

See: https://bugs.llvm.org/show_bug.cgi?id=44353

Event Timeline

sbc100 created this revision.Jan 14 2020, 11:36 AM
sbc100 abandoned this revision.Jan 14 2020, 11:44 AM