> On Jun 28, 2016, at 7:09 PM, Gao, Liming <liming....@intel.com> wrote:
> 
> Bruce:
>  Yes. We add EFIAPI in such function, and define 
> "-DEFIAPI=__attribute__((ms_abi))" in GCC CC_FLAGS. 
> 

I don't know how the version of clang used was constructed, but clang is 
inherently a cross compiler and it can easily support multiple ABIs (System V 
and X64). It comes down to how it was constructed. 

Basically a flag like -arch x86_64 will be the system default ABI, but you can 
build other stuff for the architecture via -target x86_64-pc-win32-macho. So 
for example you might be able to enable -target x86_64-pc-win32-efl. So have 
the native EFI/Windows ABI, but make an ELF with dwarf for the debugger. 

If you don't want to use the __attribute__((ms_abi)) then you might be able to 
get that support in upstream. There might already be some support for cross 
building Windows Apps on Linux that could be leveraged. You just need the 
correctly ABI, and a source level debugging scheme that works on your build 
target. 

Thanks,

Andrew Fish

> Thanks
> Liming
>> -----Original Message-----
>> From: Bruce Cran [mailto:br...@cran.org.uk]
>> Sent: Wednesday, June 29, 2016 6:45 AM
>> To: Shi, Steven <steven....@intel.com>; edk2-devel@lists.01.org; Gao,
>> Liming <liming....@intel.com>
>> Cc: Kinney, Michael D <michael.d.kin...@intel.com>; af...@apple.com
>> Subject: Re: [edk2] [PATCH 0/7] Introduce three new toolchains in edk2
>> 
>> On 6/28/16 9:18 AM, Shi, Steven wrote:
>>> Introduce three new toolchains in edk2. The first two ones support Link
>> Time Optimization (LTO) for aggressive code size improvement and the third
>> one is for static analysis.
>>> 
>>> CLANG38    : Enable LLVM Link Time Optimization (LTO) and code size
>> optimization flag (-Os) by default for aggressive code size improvement.
>>> X64 code is small code model + position independent code (PIE).
>> 
>> One problem I've run into trying to build with clang is that we have a
>> set of files which are the same across platforms, and they use varargs.
>> 
>> With gcc, we can just set -mabi=ms and be done with it, but it appears
>> clang doesn't have that option.  Do you know of a way to set the default
>> ABI with clang, or would we need to add an __attribute__((ms_abi))
>> anywhere we need to use varargs?
>> 
>> --
>> Bruce Cran
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to