[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

 

Cheers,

 

James

 

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 =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:6
4-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
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'

or 

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
Seb




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
Seb

_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

 

 
-------------- 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