[LLVMdev] linux/x86-64 codegen support

Chris Lattner sabre at nondot.org
Sat Feb 16 16:03:22 PST 2008


On Feb 16, 2008, at 3:31 PM, Andrew Lenharth wrote:

> On 2/16/08, Chris Lattner <sabre at nondot.org> wrote:
>>
>> This is very strange.  I built a cross compiler to x86_64-unknown-
>> linux-gnu and it seems to work for me:
>>
>> ./cc1 /Users/sabre/pr1711.c -emit-llvm -quiet -O2 -o -
>>
>> 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:64-v64:64:64-v128:128:128-a0:0:64- 
>> s0:64:64-
>> f80:128:128"
>> target triple = "x86_64-unknown-linux-gnu"
>>        %struct.cpp_reader = type opaque
>>
>> define i32 @_cpp_interpret_identifier(%struct.cpp_reader* %pfile, i8*
>> %id, i64 %len) nounwind  {
>> entry:
>>        ret i32 undef
>> }
>
> This is what I get with the non-bootstrap version.

Ahh, ok.  Somehow I didn't understand that this only happens when  
bootstrapping.  It appears that the front-end builds file with -- 
disable-bootstrap.

In this case, I can guess what is going on.  This is probably due to  
the fact that llvm does not currently obey the X86-64 abi in some  
cases, particularly with respect to struct return.  When  
bootstrapping, the C++ parts of the front-end are built with the  
native gcc compiler and the c parts are built with the bootstrapped C+ 
+ compiler.  We're planning to fix the x86-64 abi issues (or make them  
much closer) for llvm 2.3, so I guess we'll have to wait for this  
(it's a big project).

Until then, using --disable-bootstrap is a reasonable workaround.   
Thanks for the help everyone!

-Chris 



More information about the llvm-dev mailing list