This is an archive of the discontinued LLVM Phabricator instance.

[LinkerWrapper] Do not extract globals with no offloading language
ClosedPublic

Authored by jhuber6 on Mar 17 2023, 1:17 PM.

Details

Summary

The linker wrapper needs to reinvent its own special static library
handling for static libraries containing fatbinaries. This is primarily
because offloading languages expect certain global symbols to be visible
to the host so we must consider them used symbols. However we should be
able to remove this requirement if we are linking in "freestanding" code
that was not created by an offloading language.

The motivation for this is to support the work-in-progress libc for
GPUs. It is provided as a static library with no offloading language
set. This logic will let us only import used libc symbols always.

Diff Detail

Event Timeline

jhuber6 created this revision.Mar 17 2023, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2023, 1:17 PM
jhuber6 requested review of this revision.Mar 17 2023, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2023, 1:17 PM
jhuber6 updated this revision to Diff 506190.Mar 17 2023, 1:32 PM

Remove whitespace

yaxunl accepted this revision.Mar 27 2023, 6:55 AM

LGTM. Thanks.

This revision is now accepted and ready to land.Mar 27 2023, 6:55 AM
This revision was landed with ongoing or failed builds.Mar 27 2023, 9:38 AM
This revision was automatically updated to reflect the committed changes.