This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Append " [--no-allow-shlib-undefined]" to the corresponding diagnostics
ClosedPublic

Authored by MaskRay on Jun 2 2020, 1:03 PM.

Details

Summary

--no-allow-shlib-undefined (enabled by default when linking an
executable) rejects unresolved references in shared objects.

Users may be confused by the common diagnostics of unresolved symbols in
object files (LLD: "undefined symbol: foo"; GNU ld/gold: "undefined reference to")

Learn from GCC/clang " [-Wfoo]": append the option name to the
diagnostics. Users can find relevant information by searching
"--no-allow-shlib-undefined". It should also be obvious to them that
the positive form --allow-shlib-undefined can suppress the error.

Also downgrade the error to a warning if --noinhibit-exec is used (compatible
with GNU ld and gold).

Diff Detail

Event Timeline

MaskRay created this revision.Jun 2 2020, 1:03 PM
psmith accepted this revision.Jun 2 2020, 1:54 PM

LGTM, looks like a good idea. We may find other places where this form will be useful.

This revision is now accepted and ready to land.Jun 2 2020, 1:54 PM
grimar accepted this revision.Jun 3 2020, 2:12 AM

LGTM too.

MaskRay edited the summary of this revision. (Show Details)Jun 3 2020, 7:58 AM
MaskRay updated this revision to Diff 268203.Jun 3 2020, 7:59 AM

Add a missing prefix in an error

This revision was automatically updated to reflect the committed changes.