Compiling with Clang for target Windows Phone ARM


I would like to compile a C program with Clang for Windows Phone ARM target.

The host machine is amd64 running Windows 8.
I’m using the out of the box Clang 3.1 release binary for Windows and MinGW.

I run:

clang -v -target arm -I. -c c:\TEST\a.c -o c:\TEST\a.o

I get the following:

clang version 3.1 (branches/release_31)
Target: arm
Thread model: posix
clang: warning: unknown platform, assuming -mfloat-abi=soft

error: unable to create target: ‘No available targets are compatible with this triple, see -version for the available targets.’

When I run llc --verions

LLVM version 3.1svn
DEBUG build with assertions.
Built Jan 27 2013 (15:12:16).
Default target: i686-pc-win32
Host CPU: i686

Registered Targets:
c - C backend
x86 - 32-bit X86: Pentium-Pro and above
x86-64 - 64-bit X86: EM64T and AMD64

So no ARM LLVM backend.

Is there any particular reason for not supporting ARM on Windows host?

If no, do I have to recompile both LLVM and Clang or only Clang?


When 3.1 was released, LLVM only built host targets on Windows by
default. That's probably why those are the only ones in the release

The default has since been changed, so you compile a more recent
version of clang it should get all the backends for free. Otherwise
you can recompile 3.1 with the cmake option -DLLVM_ENABLE_TARGETS=all
or something (wild guess).

  Registered Targets:
    c - C backend
    x86 - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64


Support for Windows x86 is experimental, Windows ARM is non-existent.

So far, for ARM, the only supported OSs are Linux and FreeBSD, with the
former having continuous tests, but not the latter.

Is there any particular reason for not supporting ARM on Windows host?

Yes, lack of interest. Nobody cares enough to work on it, I'm afraid.

If you do care, and want to work on it, we'd love to have your patches. And
buildbots. :wink: