Skip to content

Supporting non-host LLVM Targets #932

@junlarsen

Description

@junlarsen

Supporting other Stable Targets

As of right now (1.5.4-SNAPSHOT) the LLVM build is set to only enable the target the host we're building for(1). Is there a specific reason we're only enabling the host target? This makes the current LLVM binary unable to cross-compile because it doesn't have the other backends.

Supporting Experimental Targets

As of LLVM 10.0.1 LLVM has 19(2) targets, 17(3) of which are "stable", experimental backends being AVR and ARC. If we do decide to enable all the stable targets, we should also consider providing support for the experimental backends.

We should also note that AVR has become a stable backend as of LLVM 11.0.0-rc1.

Footnotes

  1. In the cppbuild.sh, the Cmake -DLLVM_TARGETS_TO_BUILD variable is set to host, or whichever target if we are cross-compiling LLVM itself. One would assume this enables the target equal to the one we're building LLVM on, but I couldn't find anything regarding host in the LLVM Cmake build. I do believe it is currently only enabling the targets for the host arch though, because LLVMGetFirstTarget() with LLVMGetNextTarget() only yields the platform the binary was built for.

  2. List of targets https://github.com/llvm/llvm-project/tree/llvmorg-10.0.1/llvm/lib/Target

  3. List of stable targets https://github.com/llvm/llvm-project/blob/llvmorg-10.0.1/llvm/CMakeLists.txt#L288

Would love to hear your thoughts about this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions