modular icon indicating copy to clipboard operation
modular copied to clipboard

[Docs] Enumerate all supported target features for compiler options in man pages

Open lable-bit opened this issue 2 years ago • 4 comments

Where is the problem?

mojo build --target-features

What can we do better?

支持哪些枚举,我希望在ubuntu 上 做树莓派的交叉编译 ,armv7l

Anything else?

No response

lable-bit avatar Sep 12 '23 12:09 lable-bit

Thanks for your question! We definitely should improve the documentation here on which targets are supported in the compiler.

I don't know all the specifics right now, but I do know that we currently do not support 32-bit ARM architectures, which armv7 is.

scottamain avatar Sep 12 '23 16:09 scottamain

may ~ list it ? happy mojo~

lable-bit avatar Sep 14 '23 05:09 lable-bit

From the build documentation I see that I can specify --target-triple <TRIPLE>

What are the allowed triples? Are they similar to clang’s?

“The triple has the general format <arch><sub>-<vendor>-<sys>-<env>, where: arch = x86_64, i386, arm, thumb, mips, etc. sub = for ex. on ARM: v5, v6m, v7a, v7m, etc. vendor = pc, apple, nvidia, ibm, etc. sys = none, linux, win32, darwin, cuda, etc. env = eabi, gnu, android, macho, elf, etc.”

Is there somewhere in the source code that I can find it?

jchidley avatar Nov 04 '23 12:11 jchidley

For anyone who also search for the list of target-features, you can get them by running this command: llc -march=[TARGET_ARCH] -mattr=help

And if you have rust installed you also can run: rustc --print=target-features for --target-features rustc --print=target-cpus for --target-cpu rustc --print=target-list for --target-triple

accplan avatar Nov 11 '23 23:11 accplan