This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Adjust PIC handling for the AMDGPU ToolChain
ClosedPublic

Authored by jhuber6 on Jan 31 2023, 11:02 AM.

Details

Summary

The AMDGPU target only emits shared libraries currently. This patch
changes the handling of the PIC level to be managed in the
AMDGPUToolChain rather than having a special case for it. This causes
--target=amdgcn-- to no longer set the PIC. This should be an
acceptable change since that doesn't use a correct toolchain anyway.

Diff Detail

Event Timeline

jhuber6 created this revision.Jan 31 2023, 11:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2023, 11:02 AM
jhuber6 requested review of this revision.Jan 31 2023, 11:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2023, 11:02 AM
arsenm accepted this revision.Jan 31 2023, 11:06 AM

I don't understand how the PIC options are supposed to propagate given that codegen seems to still use magic flags but removing a special case seems good

clang/lib/Driver/ToolChains/AMDGPU.h
71

What's the difference between isPICDefault and isPICDefaultForced?

This revision is now accepted and ready to land.Jan 31 2023, 11:06 AM
jhuber6 added inline comments.Jan 31 2023, 11:20 AM
clang/lib/Driver/ToolChains/AMDGPU.h
71

isPICDefaultForced more or less just overrides -fpie or similar AFAIK.

This revision was landed with ongoing or failed builds.Jan 31 2023, 12:31 PM
This revision was automatically updated to reflect the committed changes.