This is an archive of the discontinued LLVM Phabricator instance.

Add basic aarch64-none-elf bare metal driver.
ClosedPublic

Authored by kristof.beyls on Oct 5 2021, 5:05 AM.

Diff Detail

Event Timeline

kristof.beyls created this revision.Oct 5 2021, 5:05 AM
kristof.beyls requested review of this revision.Oct 5 2021, 5:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 5 2021, 5:05 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
peter.smith accepted this revision.Oct 5 2021, 9:18 AM
peter.smith added a subscriber: peter.smith.

LGTM thanks for the update. This looks like it follows the same format as the other <arch>-none-elf toolchains, and AArch64 can benefit from the bare-metal driver for easier access to LLD. Will be worth waiting a few days to see if there is any other feedback.

This revision is now accepted and ready to land.Oct 5 2021, 9:18 AM
MaskRay added inline comments.Oct 6 2021, 10:23 AM
clang/lib/Driver/ToolChains/BareMetal.cpp
133

Is vendor check necessary?

clang/test/Driver/baremetal.cpp
105

You may follow the style in linux-cross.cpp and enumerate include paths.

Updated test based on feedback from @MaskRay

clang/lib/Driver/ToolChains/BareMetal.cpp
133

I'm guessing that without the vendor check, triples aarch64-anything-elf would also be considered bare metal triples?
Or would it be aarch64-none-anything-elf?
I'm afraid I don't know the answer to the question on whether the vendor check should be removed or not.

However, I think it's best for this patch to keep this as is to keep consistency with the arm and riscv bare metal targets in this file, which also have the same check for the triple vendor to be UnknownVendor.

If it would be best to drop this check, it probably would be best to do it as a separate patch, and potentially make the change for the arm and riscv triples too?

run clang-format on the patch.

@MaskRay - gentle ping: I wonder if you have any further remarks after I updated the patch based on your earlier feedback?

This revision was landed with ongoing or failed builds.Oct 22 2021, 12:15 AM
This revision was automatically updated to reflect the committed changes.