Page MenuHomePhabricator

[lld-macho] Support -add_ast_path
ClosedPublic

Authored by int3 on Apr 7 2021, 4:18 PM.

Details

Reviewers
clayborg
Group Reviewers
Restricted Project
Commits
rGc23b92acd065: [lld-macho] Support -add_ast_path
Summary

Swift builds seem to use it. All it requires is emitting the
corresponding paths as STABS.

Fixes llvm.org/PR49385.

Diff Detail

Event Timeline

int3 created this revision.Apr 7 2021, 4:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2021, 4:18 PM
Herald added a subscriber: dang. · View Herald Transcript
int3 requested review of this revision.Apr 7 2021, 4:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2021, 4:18 PM
int3 edited the summary of this revision. (Show Details)Apr 7 2021, 4:19 PM

The N_AST symbol is used to specify a file on disk that contains the one and only Swift AST blob. This blob of data will be given back to the Swift compiler that is built into LLDB. I don't think this can be specified multiple times. Inline comments ask if

lld/MachO/Options.td
539–542

Does this allow specifying this option more than once? I don't believe this is supported as there should only be one N_AST.

lld/MachO/SyntheticSections.cpp
683

I don't think we can have more than one N_AST values emitted. Does ld64 supports multiple?

685

Does ld64 put the mod time of the AST file in the symbol table value? I can't remember, but it would be worth checking

int3 added inline comments.Apr 7 2021, 7:39 PM
lld/MachO/SyntheticSections.cpp
683

ld64 does support multiple. Do you think we should emit just one value regardless?

685

It doesn't. (add-ast-path.s passes as-is if ld is substituted for %lld).

clayborg accepted this revision.Apr 8 2021, 10:56 AM

Thanks for checking. As long as ld64 allows multiple, I am good.

This revision is now accepted and ready to land.Apr 8 2021, 10:56 AM
This revision was landed with ongoing or failed builds.Apr 8 2021, 11:13 AM
This revision was automatically updated to reflect the committed changes.