This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Add --ignore-auto-link-option
ClosedPublic

Authored by keith on Oct 8 2022, 9:31 PM.

Details

Reviewers
int3
Group Reviewers
Restricted Project
Commits
rG47f9722c32be: [lld-macho] Add --ignore-auto-link-option
Summary

This provides a workaround for a small difference in ld64 behavior where
ld64 ignores invalid LC_LINKER_OPTIONS unless the link fails. Instead of
fully adopting that behavior, this provides an escape hatch by allowing
users to specify --ignore-auto-link-option passing the invalid library
or framework name

Fixes https://github.com/llvm/llvm-project/issues/56939

Diff Detail

Event Timeline

keith created this revision.Oct 8 2022, 9:31 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 8 2022, 9:31 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
keith requested review of this revision.Oct 8 2022, 9:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2022, 9:31 PM
keith updated this revision to Diff 466342.Oct 8 2022, 10:07 PM

Rename variable, still plural

hmm this places the burden on the end user to manually put together the list of frameworks to be ignored. Why not have a flag that turns all LC_LINKER_OPTION load failures into warnings?

I don't feel super strongly about this either way though. @thakis, do you have any opinions?

Why not have a flag that turns all LC_LINKER_OPTION load failures into warnings

I think the alternative to this is that we mirror the ld64 behavior somehow, because changing these to warnings would just end up with you having unsolvable warnings instead

int3 accepted this revision.EditedOct 11 2022, 11:36 AM

lgtm (@thakis also gave the OK over discord)

lld/MachO/Config.h
172

can we have a comment explaining the motivation behind this option?

lld/MachO/Options.td
997–1002

this should be under grp_lld (and moved to the top of the file with the rest of the options in that group)

This revision is now accepted and ready to land.Oct 11 2022, 11:36 AM
int3 added a comment.Oct 11 2022, 11:36 AM

I think the alternative to this is that we mirror the ld64 behavior somehow, because changing these to warnings would just end up with you having unsolvable warnings instead

Yeah fair, we shouldn't make it too difficult for people to turn on -fatal_warnings

keith updated this revision to Diff 466965.Oct 11 2022, 4:09 PM
keith marked 2 inline comments as done.

Update option and comments

This revision was landed with ongoing or failed builds.Oct 11 2022, 4:12 PM
This revision was automatically updated to reflect the committed changes.