[cfe-dev] How do I call clang for AVR targets?

Craig Topper via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 20 13:20:08 PDT 2017


Only these targets are built by default in cmake. AVR doesn't appear to be
one of them. So that probably means the release binaries don't build it
either. You can check what targets have been compiled in by using "llc
--version"


# List of all targets to be built by default:
set(LLVM_ALL_TARGETS
  AArch64
  AMDGPU
  ARM
  BPF
  Hexagon
  Lanai
  Mips
  MSP430
  NVPTX
  PowerPC
  Sparc
  SystemZ
  X86
  XCore
  )


~Craig

On Wed, Sep 20, 2017 at 12:53 PM, Bodo Wenzel via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> As an developer in the world of embedded control I'm playing around with
> Clang to see its capabilities. And since it is advertised as being usable
> for ARM and AVR (among a lot of other targets) I tried these.
>
> Here at home I'm running Linux, but at the job I'm bound to use Windows.
> So I'm using Clang 5.0.0 installed by the provided Windows x64 installer.
> The AVR-GCC is the current WinAVR from 2010. (Yes, I'm aware that there are
> newer versions, but I have to use this one due to company policies.)
>
> With the ARM target I had no problems; compiling with Clang and linking
> with GCC produced executables that ran fine in a simulator. I have no real
> machine at hand in the moment to check further.
>
> But the AVR target gives me a hard time. Anything I tried leads to the
> error "unable to create target: 'No available targets are compatible with
> this triple.'"
>
> There is a lot to read at the websites of Clang and LLVM, and I did read.
> But unfortunately I found nothing helpful.
>
> Finally I tried to follow the source code but to no avail.
>
> The command line is like
> "clang -target avr -mmcu=atmega128 -I<path-to-winavr-includes> source.c"
>
> These are the targets I tried:
> avr
> avr-unknown-unknown
> avr-elf
> avr-gcc
>
> What command line is supposed to be given for a successful compilation?
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170920/abd6bc02/attachment.html>


More information about the cfe-dev mailing list