This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Ignore -arch_errors_fatal since it's enabled by default
AbandonedPublic

Authored by keith on Nov 2 2021, 5:07 PM.

Details

Reviewers
gkm
int3
Group Reviewers
Restricted Project
Summary

This ld64 flag is enabled by default via this logic

https://github.com/llvm/llvm-project/blob/1a605f395ff079ced140f04ee743dbfc7fc46ec9/lld/MachO/InputFiles.cpp#L791-L797

ld64 does not have a way to disable this either. Given this we can
safely ignore this flag instead of warning about it.

Diff Detail

Event Timeline

keith created this revision.Nov 2 2021, 5:07 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a subscriber: dang. · View Herald Transcript
keith requested review of this revision.Nov 2 2021, 5:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2021, 5:07 PM
int3 added a subscriber: int3.Nov 2 2021, 6:58 PM

ld64 does not have a way to disable this either

I'm confused; doesn't ld64 *not* fatal by default when encountering this error?

(I'm actually working with a local build right now that has this arch mismatch issue, and I'd patched my local LLD to work around it -- just hadn't gotten around to upstreaming the change)

keith added a comment.Nov 2 2021, 7:17 PM

ld64 does not have a way to disable this either

I'm confused; doesn't ld64 *not* fatal by default when encountering this error?

(I'm actually working with a local build right now that has this arch mismatch issue, and I'd patched my local LLD to work around it -- just hadn't gotten around to upstreaming the change)

Correct by default ld64 does not fatal when it finds an input with an arch mismatch, it just warns. AFAIK this option in ld64 was pretty recent.

int3 added a comment.Nov 2 2021, 7:27 PM

Right, so ld64 doesn't have a way to disable this fatal because it's already disabled...

But yeah I would prefer that we hewed to ld64's behavior here so that LLD is easier to use as a drop-in replacement

keith added a comment.Nov 2 2021, 8:16 PM

Right, so ld64 doesn't have a way to disable this fatal because it's already disabled...

Exactly. I was just saying that we could safely ignore this (if we were ok to have the behavior difference) that we wouldn't need to publicize this flag at all.

But yeah I would prefer that we hewed to ld64's behavior here so that LLD is easier to use as a drop-in replacement

Ok so you think we should swap the existing error for a warning, and enable this flag to act as it does today?

FWIW I think the risk of this being a blocker for adoption is pretty low, but I totally take your point.

int3 added a comment.Nov 2 2021, 8:20 PM

Ok so you think we should swap the existing error for a warning, and enable this flag to act as it does today?

Yup!

FWIW I think the risk of this being a blocker for adoption is pretty low, but I totally take your point.

Well as mentioned, one of the internal builds I'm working with has this issue already :/ I could probably fix it but yeah it's a pain

keith added a comment.Nov 2 2021, 10:39 PM

Attempt at the real implementation of this here https://reviews.llvm.org/D113082

int3 requested changes to this revision.Nov 3 2021, 9:27 PM

Guess this is no longer needed?

This revision now requires changes to proceed.Nov 3 2021, 9:27 PM