This is an archive of the discontinued LLVM Phabricator instance.

[Libomptarget] Fix multiply defined symbol during linking
ClosedPublic

Authored by jhuber6 on Jan 13 2022, 8:41 AM.

Details

Summary

This patch adds the weak identifier to the openmp device environment
variable. The changes introduced in https://reviews.llvm.org/D117211
result in multiply defined symbols. Because the symbol is potentially
included multiple times for each offloading file we will get symbol
colisions, and because it needs to have external visiblity it should be
weak.

Diff Detail

Event Timeline

jhuber6 requested review of this revision.Jan 13 2022, 8:41 AM
jhuber6 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2022, 8:41 AM
JonChesterfield accepted this revision.Jan 13 2022, 8:50 AM

Sure, it can be weak. Definition in the old devicertl too please. I guess we have multiple copies because there are multiple TUs each with their own internalized RTL, and this symbol needs to exist in isolation so the host runtime only has to patch one of them. Thanks!

This revision is now accepted and ready to land.Jan 13 2022, 8:50 AM
jhuber6 updated this revision to Diff 399690.Jan 13 2022, 8:57 AM

Adding changes to old runtime.

This revision was landed with ongoing or failed builds.Jan 13 2022, 8:57 AM
This revision was automatically updated to reflect the committed changes.