This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Add --no-warnings/-w
ClosedPublic

Authored by MaskRay on Oct 23 2022, 4:23 PM.

Details

Summary

Mach-O ld64 supports -w to suppress warnings. GNU ld 2.40 will support the
option as well (https://sourceware.org/bugzilla/show_bug.cgi?id=29654).

This feature has some small value. E.g. when analyzing a large executable with
relocation overflow issues, we may use --noinhibit-exec --emit-relocs to get
relocations and an output file despite relocation overflow issues. -w can significantly
improve the link time as printing the massive warnings is slow.

Diff Detail

Event Timeline

MaskRay created this revision.Oct 23 2022, 4:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2022, 4:23 PM
MaskRay requested review of this revision.Oct 23 2022, 4:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2022, 4:23 PM
peter.smith accepted this revision.Oct 24 2022, 1:24 AM

I think it makes sense as the first level of warning control and matching the GNU ld featureset is useful.

One thing we may want to do in the future is have named individual warnings like clang that can be individually suppressed. I've found that useful in Arm's proprietary linker as customers sometimes find a single warning annoying, but don't want to turn of all warnings. This is a lot more effort to implement and maintain though.

This revision is now accepted and ready to land.Oct 24 2022, 1:24 AM

Thanks for the quick review!

This revision was automatically updated to reflect the committed changes.