[cfe-users] Problem compiling simple main.c with llvm-5.0

Don Hinton via cfe-users cfe-users at lists.llvm.org
Thu Dec 28 11:31:48 PST 2017


Looks like AVR is experimental, so you'll need to pass it via
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="AVR"

As for the correct --target, you can take a look at the logic in
llvm/cmake/config.guess to get an idea on how to construct one.

hth...
don

On Wed, Dec 13, 2017 at 2:15 AM, via cfe-users <cfe-users at lists.llvm.org>
wrote:

> Hi, I am new to llvm, so my first question is if this is the right
> mailing list to address respective problems using that software.
>
> I downloaded the llvm 5.0.0 binary bundle, and I can compile simple
> main.c for x64_64 host.  However, when
>
> .../bin/clang main.c --target=avr
> error: unable to create target: 'No available targets are compatible with
> this triple.'
> 1 error generated.
>
> As --help is not much help, I tried guessing around using targets
> elf32-avr, avr-unknown-none, all giving the same, unspecific diagnostic
> (so much for "extremely useful error and warning messages").
>
> https://clang.llvm.org/docs/CrossCompilation.html
>
> claims:
>
> > On the other hand, Clang/LLVM is natively a cross-compiler, meaning
> > that one set of programs can compile to all targets by setting the
> > -target option.
>
> I checked the v5.0 sources, there are plenty of modules dealing with
> AVR, so that target should be supported. No?
>
> So I downloaded the llvm 5.0.0 source bundle and configured for AVR:
>
> $ cmake -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="AVR"
> ../../source/llvm-5.0.0.src/
>
> But:
>
> -- Constructing LLVMBuild project information
> CMake Error at CMakeLists.txt:688 (message):
>   The target `AVR' does not exist.
>
>       It should be one of
>
>
> AArch64;AMDGPU;ARM;BPF;Hexagon;Lanai;Mips;MSP430;NVPTX;
> PowerPC;Sparc;SystemZ;X86;XCore
>
> -- Configuring incomplete, errors occurred!
> See also ".../build/llvm-5-avr/CMakeFiles/CMakeOutput.log".
> See also ".../build/llvm-5-avr/CMakeFiles/CMakeError.log".
>
> The 5.0.0 release notes have some mention of AVR
>
> http://releases.llvm.org/5.0.0/docs/ReleaseNotes.html#change
> s-to-the-avr-target
>
> so I'd expect this target is supported?
>
> Thanks for any help.
>
> _______________________________________________
> cfe-users mailing list
> cfe-users at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20171228/66dd4722/attachment.html>


More information about the cfe-users mailing list