Page MenuHomePhabricator

[Driver][AVR] Fix warn_drv_avr_stdlib_not_linked condition
ClosedPublic

Authored by MaskRay on Mar 27 2022, 10:30 PM.

Details

Summary

Many options (-fsyntax-only, -E, -S, etc) skip the link action phase which the
existing condition does not account for.

Since the code no longer specifies OPT_c, I think a single RUN line about -c
not leading to a warning is sufficient. Adding one for all of -E,
-fsyntax-only, -S would be excessive.

Diff Detail

Event Timeline

MaskRay created this revision.Mar 27 2022, 10:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2022, 10:30 PM
MaskRay requested review of this revision.Mar 27 2022, 10:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2022, 10:30 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MaskRay updated this revision to Diff 418493.Mar 27 2022, 10:33 PM

fix file header

benshi001 accepted this revision.Mar 28 2022, 7:43 AM
benshi001 added inline comments.
clang/lib/Driver/ToolChains/AVR.cpp
451

I think we should warn empty CPU name in the compile stage. For example, if user specified -c but not -mmcu, then we can not run to here to warn cpu is empty.

So I will accept and rebase on your code.

This revision is now accepted and ready to land.Mar 28 2022, 7:45 AM
This revision was landed with ongoing or failed builds.Mar 28 2022, 9:43 AM
This revision was automatically updated to reflect the committed changes.
MaskRay added inline comments.Mar 28 2022, 9:44 AM
clang/lib/Driver/ToolChains/AVR.cpp
451

The original code suggested that the diagnostic was intended for linking. As such, it should not fire for -c.