[LLVMdev] Unifying Windows Target Triples

Saleem Abdulrasool abdulras at fb.com
Fri Feb 28 11:10:33 PST 2014


On Feb 27, 2014, at 11:59 PM, NAKAMURA Takumi <geek4civic at gmail.com> wrote:

> Saleem,
> 
> Thanks to open the Pandora's box!

Agreed that this is probably pandora’s box, but, I think that addressing this now will help with the addition of Windows on ARM.

> I am certain "Win32" should be common word to represent Win32 API (ABI
> in some context).
> Then, I preferer -win32- rather than -windows-.
> If we could use *-win32, I hope it might be neutral as possible.
> That said, I don't have concrete plan what *-win32 should be.

I agree that Windows is less precise, but that ambiguity is slightly on purpose.  Win32 is not the OS, its more the set of APIs.  Using windows permits us the ability to handle various different scenarios related to Windows (consider the case of Windows drivers where the Windows Kernel APIs are targeted rather than the WIN32 APIs).

> In other words, I think it'd be worse that "*-pc-win32" represents
> whole msvc things.
> 
> I could make the matrix later. This is a random note.
> 
> * i686-pc-cygwin (gcc-4.x)
>  - PE/COFF
>  - Win32 compatible. Win32 API(s) could be available with <windows.h>.
>  - Doesn't use thiscall.
>  - Doesn't use msvcrt. Using newlib delivered.
>  - Uses GNU libstdc++ and libsupc++.
>  - Uses dw2 eh.
> 
> * i686-pc-mingw32 (<4.6)
>  - Uses msvcrt.dll. (malloc is not 16-byte aligned). Other versions
> of msvcrt are optional.
>  - Uses some supplemental libs that incapable in msvcrt.dll.
>  - Uses libgcc
>  - Uses GNU libstdc++ and libsupc++ provided by g++ (lib/gcc/i686-pc-mingw32)
>  - Doesn't use thiscall.
>  - dw2 is available older version of mingw32 was available only sjlj.
> 
> * *-w64-mingw32 (>=4.6)
>  - Uses msvcrt.dll even on x86_64 (!!!)
>  - EH is optional, x64-comptatible eh (aka seh) may be available.
>  - multilib is available in development environment.
>  - Uses thiscall (for i686)
>  - Uses GNU libstdc++.
> 
> * x86_64-pc-cygwin
>  - LP64
>  - Investigating :p

MinGW32-W64 is a rework of MinGW32.  AFAIK, it has entirely superseded MinGW32, so the “gnu” environment would represent both of these.

MinGW32-W64 is a fork of cygwin.  The “gnu” environment would cover cygwin as well.  If they have diverged significantly, cygnus vs gnu could be used to differentiate them.

> I wonder if we could provide neutral *-win32 for our project, or naked
> *-win32 might be used as non-C++ environments...
> (Consider with compiler-rt, libcxxabi and libcxx)

The windows-msvc would cover the pure C case.  If you are using libc++/libc++abi then you need a C++ ABI.  That would be covered by the windows-itanium target.

> ...Takumi
> 
> 
> 2014-02-28 12:40 GMT+09:00 Saleem Abdulrasool <abdulras at fb.com>:
>> Hi,
>> 
>> After a discussion with David, Id like to propose a rework of the Windows target triples.  The current set of Windows triples are somewhat less uniform than their Linux counterparts.  With multiple ABIs and environments on Windows, they are also slightly awkward.  Obviously, certain ones might be nice to keep around for compatibility (e.g. the mingw triple).
>> 
>> Just to ensure that everyone has the same understanding, the canonical format for a triple is: arch-vendor-os-environment .
>> 
>> We have the following environment on Windows:
>> 
>> As far as I know, everyone conforms to the MS C ABI.
>> - There is the MS C++ ABI which is still being developed.
>> - There is the IA-64 ABI which is incompatible with msvcprt.
>> - There is the MinGW sub environment which supplies additional UNIX-y functions and uses IA-64 ABI for C++.
>> 
>> The Windows environment is uniformly (COFF)/PE.
>> 
>> As for the OS, Windows is slightly generic.  Windows 9x, Windows NT, and Windows CE are all slightly different.  However, given that Microsoft has taken a unifying strategy with Windows NT, I *think* sticking to Windows for the OS should be okay.  That said, I could be convinced to use winnt or windowsnt.
>> 
>> So, one way to clearly define a naming scheme for this space would be something along the lines of:
>> 
>> {armv7,i686,x86_64}-windows-{ia,mingw,ms}pe
>> 
>> This allows us to uniformly take any of the combination IA-64 or MS C++ ABI + MS C ABI or the MinGW environment (which is IA-64 ABI and its supplementary libraries).
>> 
>> I understand that this may be controversial since it can potentially break existing code bases, but I think that the result of this is worth it.
>> 
>> --
>> Saleem Abdulrasool
>> abdulras (at) fb (dot) com
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         https://urldefense.proofpoint.com/v1/url?u=http://llvm.cs.uiuc.edu/&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=CchYc4lrV44%2BZqxZADw0BQ%3D%3D%0A&m=WR6HDEoM%2FRJivypqKu8UMSJ3E6UIfOwCb3WXdmZj65g%3D%0A&s=a6333230f7222d44c2d4683c14795046a9bb074f94dff58d9156200245d4f02d
>> https://urldefense.proofpoint.com/v1/url?u=http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=CchYc4lrV44%2BZqxZADw0BQ%3D%3D%0A&m=WR6HDEoM%2FRJivypqKu8UMSJ3E6UIfOwCb3WXdmZj65g%3D%0A&s=d32328e604ef1f1744d93d7063b8f165a2c6d341abd8110a25ade496754d1f11

-- 
Saleem Abdulrasool
abdulras (at) fb (dot) com









More information about the llvm-dev mailing list