This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][Driver] Allow the use of CPUs with a different XLEN than the triple.
ClosedPublic

Authored by kito-cheng on Apr 12 2023, 6:17 AM.

Details

Summary

Our downstream toolchain release got some issue is we set the default
triple by creating symbolic link of clang like riscv64-unknown-elf-clang,
and has lots of multi-lib config including rv32's config.

However when we trying to set arch by a 32 bit CPU like generic-rv32
but got error message below:
error: unsupported argument 'generic-rv32' to option '-mcpu='

generic-rv32 is listed in the output of -mcpu=help, that
might be confusing for user since help message say supported.

So let clang driver also consider -mcpu option during computing
the target triple to archvie that.

Diff Detail

Event Timeline

kito-cheng created this revision.Apr 12 2023, 6:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2023, 6:17 AM
kito-cheng requested review of this revision.Apr 12 2023, 6:17 AM

What is the interaction between this and the -m32 and -m64 options?

This revision is now accepted and ready to land.Apr 13 2023, 12:19 PM
asb accepted this revision.Apr 17 2023, 9:59 PM

LGTM.

Thx. It has solved the issue D129824.

evandro removed a subscriber: evandro.May 18 2023, 7:54 AM