This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Error if ARM mode was selected explicitly for M-profile CPUs.
ClosedPublic

Authored by fhahn on Jul 25 2017, 2:47 AM.

Details

Summary

M-class profiles do not support ARM execution mode, so providing
-marm/-mno-thumb does not make sense in combination with -mcpu/-march
options that support the M-profile.

This is a follow-up patch to D35569 and it seemed pretty clear that we
should emit an error in the driver in this case.

We probably also should warn/error if the provided -mcpu/-march options
do not match, e.g. -mcpu=cortex-m0 -march=armv8-a is invalid, as
cortex-m0 does not support armv8-a. But that should be a separate patch
I think.

Diff Detail