This is an archive of the discontinued LLVM Phabricator instance.

Fix crash with unsupported architectures in Linux/Gnu target triples.
ClosedPublic

Authored by fhahn on Nov 23 2016, 2:30 PM.

Details

Summary

This patch adds a check and an error message to gnutools::Linker::ConstructJob in case the architecture is not supported. For most other operating systems, the error message is created in lib/Basic/Targets.cpp:AllocateTarget, but when construction the linker arguments for the gnutools linker a supported architecture is required.

Event Timeline

fhahn updated this revision to Diff 79150.Nov 23 2016, 2:30 PM
fhahn retitled this revision from to Fix crash with unsupported architectures in Linux/Gnu target triples..
fhahn updated this object.
fhahn added a reviewer: rafael.
fhahn added a subscriber: cfe-commits.
echristo accepted this revision.Nov 30 2016, 3:17 PM
echristo edited edge metadata.

LGTM.

Thanks!

This revision is now accepted and ready to land.Nov 30 2016, 3:17 PM
joerg accepted this revision.Nov 30 2016, 3:33 PM
joerg added a reviewer: joerg.
joerg added a subscriber: joerg.

LGTM with a small cleanup.

lib/Driver/Tools.cpp
10018

Please write this as

 if (const char *LDMOption = ...) {
   ...
} else {
   D.Diag(...);
   return;
}
fhahn updated this revision to Diff 79883.Dec 1 2016, 2:52 AM
fhahn edited edge metadata.

Addressed @joerg's comment.

fhahn marked an inline comment as done.Dec 1 2016, 2:52 AM
fhahn updated this object.Dec 1 2016, 3:10 AM
fhahn closed this revision.Dec 1 2016, 3:13 AM