[LLVMdev] Build issues on Solaris

Nathan Keynes Nathan.Keynes at Sun.COM
Tue Aug 25 21:27:23 PDT 2009


On 25/08/2009, at 5:57 PM, Anton Korobeynikov wrote:

> Hello, Nathan
>
>>> loading address of GOT into ebx before the call (on 32 bit ABIs)  
>>> thus
>>> the call will be to nowhere.
>> Good point, I didn't look closely enough at the calling sequence. I  
>> assume
>> this has to be broken on Linux/x86 at the moment too? I've done up  
>> a quick
>> and dirty implementation below for the sake of discussion, which  
>> compiles
>> (and doesn't break lli), but hasn't been tested beyond that point  
>> as yet.
>> Admittedly this adds even more versions of X86CompilationCallback,  
>> but the
>> mixed version with #ifs seemed to be pretty hard to follow.
> There was some PR wrt this issue (sorry, I remembered about it only
> now). It was decided that proper way of doing things is just declare
> the compilation callback as static - then you won't need to assemble
> call via PLT at all. There was even patch for that, however I was not
> working for me for some weird reason and I had no time to dig, why.

Ah, PR3801 I think, and yes that would be the far better way of fixing  
this. Static looks like it will work properly here, but I notice that  
the PR's patch adds the anonymous namespace rather than static. I'm  
not sure whether or not that will work in practice, but in testing it  
seems that gcc 4.3 at least still generates PLT linkage for non-static  
functions in the anonymous namespace[0].

Cheers,
Nathan

[0] Which is what I would have expected, actually.



More information about the llvm-dev mailing list