This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Temporary workaround for calling the LLD ELF driver as-a-lib
ClosedPublic

Authored by aganea on Feb 8 2022, 12:42 PM.

Details

Summary

This fixes the situation described in https://github.com/llvm/llvm-project/issues/53475 with a repro exposed by https://github.com/ROCmSoftwarePlatform/D108850-lld-bug-reproduction

This is purposely just a workaround to unblock users. This could be transplanted to the release/14.x branch if need be. A proper fix will later be provided in D119049

Diff Detail

Event Timeline

aganea created this revision.Feb 8 2022, 12:42 PM
aganea requested review of this revision.Feb 8 2022, 12:42 PM

Other than a minor typo, fixes the problem and looks good

mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
446

Missing namespace causing compilation failure

aganea updated this revision to Diff 406945.Feb 8 2022, 1:00 PM

namespace fix.

aganea marked an inline comment as done.Feb 8 2022, 1:03 PM
aganea added inline comments.
mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
446

Fixed, thanks for testing! I don't have the ROCm libs installed. I only tested with the repro you provided in https://github.com/ROCmSoftwarePlatform/D108850-lld-bug-reproduction

krzysz00 accepted this revision.Feb 8 2022, 1:31 PM

LGTM, we can poke at long-term solutions later

This at least gets everything testable again and lets us update downstream to LLVM tip.

This revision is now accepted and ready to land.Feb 8 2022, 1:31 PM
MaskRay accepted this revision.Feb 8 2022, 2:00 PM
MaskRay added inline comments.
lld/ELF/Driver.cpp
139 ↗(On Diff #406945)

If this is not ELF-specific, seems that it needs to live in lld::cleanup ? If the API (perhaps not intended as an API), we can give it an long discouraging name.

aganea updated this revision to Diff 406967.Feb 8 2022, 2:13 PM
aganea marked 2 inline comments as done.

Use more generic lld::cleanup() instead of lld::elf::cleanup()

This revision was landed with ongoing or failed builds.Feb 8 2022, 4:12 PM
This revision was automatically updated to reflect the committed changes.