This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix the linkage for kernel environment global variable
ClosedPublic

Authored by tianshilei1992 on Aug 2 2023, 5:29 PM.

Details

Summary

This patch fixes the issue that multiple definition of kernel environment global
variables can occur because of wrong linkage.

Fixes #64284.

Diff Detail

Event Timeline

tianshilei1992 created this revision.Aug 2 2023, 5:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 5:29 PM
tianshilei1992 requested review of this revision.Aug 2 2023, 5:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 5:29 PM
jhuber6 accepted this revision.Aug 2 2023, 5:30 PM

Assuming this is truly weak_odr, i.e. single definition that gets a symbol in the ELF.

This revision is now accepted and ready to land.Aug 2 2023, 5:30 PM

Assuming this is truly weak_odr, i.e. single definition that gets a symbol in the ELF.

Our previous _exec_mode is actually WeakAnyLinkage, which could potentially lead to mismatch.

rebase and fix test issue

Herald added a project: Restricted Project. · View Herald Transcript
This revision was landed with ongoing or failed builds.Aug 3 2023, 6:33 PM
This revision was automatically updated to reflect the committed changes.