This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Have --reproduce account for path rerooting
ClosedPublic

Authored by int3 on Apr 23 2021, 9:18 PM.

Details

Reviewers
oontvoo
Group Reviewers
Restricted Project
Commits
rG20f51ffe67d1: [lld-macho] Have --reproduce account for path rerooting
Summary

We need to account for path rerooting when generating the response
file. We could either reroot the paths before generating the file, or pass
through the original filenames and change just the syslibroot. I've opted for
the latter, in order that the reproduction run more closely mirrors the
original.

We must also be careful *not* to make an absolute path relative if it is
shadowed by a rerooted path. See repro6.tar in reroot-path.s for
details.

I've moved the call to createResponseFile() after the initialization of
config->systemLibraryRoots, since it now needs to know what those roots are.

Diff Detail

Event Timeline

int3 created this revision.Apr 23 2021, 9:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2021, 9:18 PM
int3 requested review of this revision.Apr 23 2021, 9:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2021, 9:18 PM
oontvoo accepted this revision.May 5 2021, 9:42 AM
oontvoo added a subscriber: oontvoo.

LGTM

lld/test/MachO/reroot-path.s
28

should this be %lld (or some other pre-set param) to ensure we're testing the "right" ld64.ldd?
(In theory, the machine could already have ld64.lld)

This revision is now accepted and ready to land.May 5 2021, 9:42 AM
int3 marked an inline comment as done.May 5 2021, 11:40 AM
int3 added inline comments.
lld/test/MachO/reroot-path.s
28

I think llvm-lit will ensure these paths map to the right things. If you run llvm-lit -vva you can see that this line invokes ld64.lld via an absolute path. (Same with other tools like llvm-objdump`)

This revision was landed with ongoing or failed builds.May 5 2021, 11:42 AM
This revision was automatically updated to reflect the committed changes.
int3 marked an inline comment as done.