This is an archive of the discontinued LLVM Phabricator instance.

[SIE] Always enable the .debug_aranges section when using LTO
ClosedPublic

Authored by ormris on Sep 20 2022, 11:23 AM.

Details

Summary

This flag enables the .debug_aranges section by passing a flag to LLD and our internal linker. This also adds a new routine that will generate the correct flag for our internal linker or set of flags for LLD when given a list of LLVM options. That ensures multiple LLVM codegen options can be passed to either linker consistently.

Diff Detail

Event Timeline

ormris created this revision.Sep 20 2022, 11:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2022, 11:23 AM
Herald added a subscriber: inglorion. · View Herald Transcript
ormris requested review of this revision.Sep 20 2022, 11:23 AM
probinson added a project: Restricted Project.Sep 20 2022, 11:32 AM

+clang tag

probinson accepted this revision.Sep 20 2022, 11:44 AM

I usually use a [PS4] tag on the commit message headline, not [SIE]. Not insisting you change it but that has been my convention.

Assuming the questions all have reasonable answers, LGTM.

clang/lib/Driver/ToolChains/PS4CPU.cpp
169

Does this cause .debug_aranges to be emitted even if debug-info wasn't asked for? I think not, but good to make sure.

clang/test/Driver/ps4-ps5-linker-jmc.c
11–12

I take it the quotes had to go, because we now unconditionally add -generate-arange-section?

This revision is now accepted and ready to land.Sep 20 2022, 11:44 AM
ormris added inline comments.Sep 20 2022, 2:43 PM
clang/lib/Driver/ToolChains/PS4CPU.cpp
169

No issues there. If -g isn't specified, the section isn't generated.

clang/test/Driver/ps4-ps5-linker-jmc.c
11–12

Correct. This will also be useful if we add more flags in the future.

This revision was landed with ongoing or failed builds.Sep 20 2022, 2:47 PM
This revision was automatically updated to reflect the committed changes.

A warning can be seen in -Asserts.

clang/lib/Driver/ToolChains/PS4CPU.cpp
160

IsPS5 is used only here.