[LLVMdev] target datalayout defintion

James Molloy james.molloy at arm.com
Mon Oct 31 01:06:18 PDT 2011

Hi Seb,


You need to use the “-ccc-host-triple” argument to Clang. We’re planning on
changing this behaviour to make it more usable.


Clang –ccc-host-triple armv7 –S –emit-llvm –mcpu=cortex-a9 –mattr=+neon

Clang –ccc-host-triple armv7 –S –emit-llvm –mcpu=cortex-a9 –mattr=-neon






From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Seb
Sent: 28 October 2011 08:22
To: Carl-Philip Hänsch
Cc: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] target datalayout defintion


I tried bu clang seems to support only target on which it has been compiled.

If I use:

with clang -S -emit-llvm t.c -o t.ll

I've got following file for t.ll 

; ModuleID = 't.c'

target datalayout =
target triple = "x86_64-unknown-linux-gnu"

Which, I think, defines datalayout for x86 64-bit target.
Now If I add -march=arm or -march=x86-32 I've got following error message
from clang:

error: unknown target CPU 'arm'


error: unknown target CPU 'x86-32'

Is there a way to build clang so that it support cross-compilation for
ARM/x86-32 ?

Best Regards

2011/10/27 Carl-Philip Hänsch <cphaensch at googlemail.com>

You can compile an empty C source code with clang -S -emit-llvm and copy the
data layout from there.

2011/10/27 Seb <babslachem at gmail.com>

Hi all, 

Can someone give me advice on what should be a good definition of target
datalayout for an ARM cortex-A9 + neon target and x86 32-bit ?
Shall I use a different definition for a cortex-A9 without neon ?
Thanks for your advices
Best Regards

LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111031/f436e7ca/attachment.html>

More information about the llvm-dev mailing list