This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Add -fatal-warnings alias
AbandonedPublic

Authored by keith on Nov 2 2021, 4:03 PM.

Details

Reviewers
gkm
Group Reviewers
Restricted Project
Summary

This behaves the same as -fatal_warnings but provides a consistent
interface with ld.lld and ld.gold. This is useful for build tools like
bazel to be able to provide a consistent interface for 'warnings as
errors' to the linker.

Diff Detail

Event Timeline

keith created this revision.Nov 2 2021, 4:03 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
keith requested review of this revision.Nov 2 2021, 4:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2021, 4:03 PM
MaskRay added a subscriber: MaskRay.Nov 2 2021, 6:01 PM

Options across binary formats are just so different. I think a user seeing -option-name may probably be more confused.
Not playing the house rule can probably just lead to confusion.

BTW: for ELF, I'd like users specify --fatal-warnings instead of -fatal-warnings.

keith added a comment.Nov 2 2021, 6:07 PM

Options across binary formats are just so different. I think a user seeing -option-name may probably be more confused.

I did hide this by default in help to steer folks towards the default. For users who don't manually pass a lot of linker flags (vs clang passing them), this might be one of the few they do pass themselves, so having that unified across linkers seems valuable to me.

BTW: for ELF, I'd like users specify --fatal-warnings instead of -fatal-warnings.

I think either option would be fine in this case if that's the recommendation

int3 added a subscriber: int3.Nov 2 2021, 7:08 PM

I'm with MaskRay here, I think each platform differs too much to have a consistent linker flag API

thakis added a subscriber: thakis.Nov 4 2021, 9:17 AM

+1; lld-link doesn't have this either, and even if we add this alias there's a ton of other options that are different. And if bazel (or similar) _requires_ this flag, it won't work with link.exe and ld64, and the point of the compatible drivers is to make linkers mostly interchangeable on each os.

(Otoh if we do end up adding it, please use two -- as prefix and move it up into the "lld-only" section further up )

keith abandoned this revision.Nov 4 2021, 9:19 AM

Thanks for the feedback