This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Improved LLD error messages in case of mixed wasm32/wasm64 object files
ClosedPublic

Authored by aardappel on Oct 29 2020, 2:04 PM.

Diff Detail

Event Timeline

aardappel created this revision.Oct 29 2020, 2:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2020, 2:04 PM
aardappel requested review of this revision.Oct 29 2020, 2:04 PM
sbc100 added inline comments.Oct 29 2020, 2:24 PM
lld/wasm/InputChunks.cpp
63

Maybe just initialize to 5 and override for the 64-bit cases.

Also maybe a better name, since this is not that amount of padded by the overall width. Howabout maxLEBWidth? Or paddedLEBWidth?

lld/wasm/InputFiles.cpp
51

No need to escape single quote is there?

Can we get tests for these new error cases?

600

Passing this at each callside makes me think this should be a method, no?

llvm/lib/MC/WasmObjectWriter.cpp
502 ↗(On Diff #301749)

Revert this ?

aardappel added inline comments.Oct 29 2020, 3:01 PM
lld/wasm/InputFiles.cpp
51

You want a test that builds two different .o files and tries to link them? Doesn't that sound a bit overkill for this? Do all LLD errors have tests? Certainly the ones we already had that I am replacing didn't.

sbc100 added inline comments.Oct 29 2020, 3:17 PM
lld/wasm/InputFiles.cpp
51

You thats exactly what I mean. If the existing error message didn't have tests they should have done.

It should be trivial to just use and empty .s file as the test, since all you need to do is compile it two ways and try to link it two ways to get each error.

Or you can use a .test that references and existing .s such as lld/test/wasm/Inputs/start.s

aardappel marked 5 inline comments as done.Oct 29 2020, 5:07 PM
aardappel added inline comments.
lld/wasm/InputFiles.cpp
51

well, it can't be empty since it

600

I considered that, but then I made it similar to the already existing toString, as an implementation detail local to this file seemed cleaner to me. Also pulls a new include into the header. But as you wish.

aardappel updated this revision to Diff 301790.Oct 29 2020, 5:09 PM
aardappel marked 2 inline comments as done.

Review fixes and tests.

sbc100 accepted this revision.Oct 29 2020, 5:11 PM

Nice!

This revision is now accepted and ready to land.Oct 29 2020, 5:11 PM