This is an archive of the discontinued LLVM Phabricator instance.

Compilation for Intel MCU (Part 1/3)
ClosedPublic

Authored by aturetsk on Mar 23 2016, 8:23 AM.

Details

Summary

This is the first patch (out of three) required to support compilation for Intel MCU target (e.g. Intel(R) Quark(TM) micro controller D 2000).

Add -miamcu option which:

  • Sets IAMCU triple
  • Sets IAMCU ABI
  • Enforces static compilation

Diff Detail

Repository
rL LLVM

Event Timeline

aturetsk updated this revision to Diff 51421.Mar 23 2016, 8:23 AM
aturetsk retitled this revision from to Compilation for Intel MCU (Part 1/3).
aturetsk updated this object.
aturetsk updated this object.Mar 23 2016, 8:34 AM
aturetsk updated this object.
bruno added a subscriber: bruno.Apr 4 2016, 10:34 AM

Hi Andrey,

include/clang/Driver/Options.td
1281 ↗(On Diff #51421)

You can remove the "." to be consistent with the other flags help text.

lib/Driver/Driver.cpp
283 ↗(On Diff #51421)

You probably don't need this - turning -static on as you do some lines below should be enough to output a warning if -dynamic is specified - see CheckCodeGenerationOptions.

387 ↗(On Diff #51421)

What happens if -m32 isn't specified and the target is != x86?

lib/Driver/Tools.cpp
2130 ↗(On Diff #51421)

One potential place you could be missing: maybe getX86TargetCPU should return Lakemont when OPT_miamcu is on? or is this coming in another patch?

aturetsk updated this revision to Diff 52789.Apr 6 2016, 7:20 AM

Fix remarks,

Hi Bruno,

Thanks for the review.

include/clang/Driver/Options.td
1281 ↗(On Diff #52789)

Fixed.

lib/Driver/Driver.cpp
282 ↗(On Diff #52789)

You're right.
The warning was removed and the test was updated.

380 ↗(On Diff #52789)

I made driver to show an error if '-miamcu' is used with anything but x86.
The corresponding test was added.

lib/Driver/Tools.cpp
2130 ↗(On Diff #52789)

No, the idea is for -miamcu to specify only ABI and it shouldn't be bound to Lakemont at all. Which target CPU to use is the choice of the user and it should be explicitly specified through -march.
I believe GCC does the same.

This revision was automatically updated to reflect the committed changes.