[llvm-commits] Patches to build EFI with clang/llvm

Carl Norum carl.norum at apple.com
Tue Jan 25 17:43:56 PST 2011


On Jan 25, 2011, at 5:40 PM, Jakob Stoklund Olesen wrote:
> On Jan 25, 2011, at 5:23 PM, Carl Norum wrote:
>>>>> Takumi recently submitted a patch to do the exact same thing. I think he managed to avoid the new instructions. I think his solution was better, assuming it works for you.
>>>> 
>>>> It very well might; I sort of inherited this code, so I'll have to dig around a bit before figuring that all out.  Has that patch gone into TOT, and if not, where can I get it from?
>>> 
>>> I think this was his latest attempt: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20110110/115159.html
>>> The changes haven't been committed, AFAIK.
>> 
>> This patch worked great here - I haven't done exhaustive testing, but I could build EFI and boot/sleep/wake a couple of machines with the resulting binaries.  Is it expected that these patches will get committed sometime in the near future?
> 
> Takumi?
> 
>> Let me know what you think about the attached Mach-O patches! 
> 
> Somebody else should look at those.
> 
> Some of the conditionals look suspicious:
> 
>> +  if (Subtarget->isTargetDarwin() || Subtarget->isTargetMacho()) {
>>      if (is64Bit)
>>        return new X8664_MachoTargetObjectFile();
>>      return new TargetLoweringObjectFileMachO();
> 
> Should that be just Subtarget->isTargetMacho()?
> 
>> -  if (TM.getSubtarget<X86Subtarget>().isTargetCOFF())
>> +  if (Subtarget->isTargetCOFF() && !Subtarget->isTargetMacho())
> 
> Can COFF and Macho be true at the same time?

I think the triple we're using confuses a lot of things.  Our output is Win32 ABI in Mach-O objects, so for our case, isTargetDarwin() is not true, but isTargetMacho() is true; it is probably the case that anything that says isTargetDarwin() is true will also return true for isTargetMachO(), though.

I guess because we have win32 in our triple (x86_64-pc-win32-macho) that somehow isTargetCOFF() is returning true.  I'll have to dig in there and see what's up with that.

-- Carl





More information about the llvm-commits mailing list