[PATCH] MINGW64 Driver, TLS and SEH exception

Yaron Keren yaron.keren at gmail.com
Tue Apr 15 13:11:16 PDT 2014


Hi Martell,

The page I linked is Kai Nacke page, note that the patch there is more
updated than the 20140201 one in several locations, major changes are

1) the test for MingW environment is now

if (is64Bit && Triple.isWindowsGNUEnvironment())

the previous test wil cause a silent bug as the OS can't be MinGW anymore
and the test is always false.

2) isPrologLabel() was replaced by by isCFIInstruction()

the previous patch will cause a compilation failure against trunk,
isPrologLabel() does not exist anymore.

3) Small code changes in X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(const
Triple &Triple) and more.

The new patch (20140414) should apply to trunk.

Yaron




2014-04-15 22:11 GMT+03:00 Martell Malone <martellmalone at gmail.com>:

> Yaron
>
> After looking at the code differences from the updated seh patch you
> linked me from kai
> I have noticed that the only change from my patch is that I am using
>
> X86RegisterInfo
> instead of
> TargetRegisterInfo
>
> So his patch looks good to me other than calling that virtual method which
> would cause a compile error.
>
> On a side note doxygen is messing up the X86RegisterInfo class name
> because of the final word
> http://llvm.org/doxygen/classllvm_1_1final.html
>
>
>
>
>

On Tue, Apr 15, 2014 at 7:59 PM, Martell Malone <martellmalone at gmail.com>wrote:

> Hi Reid,
>
> TLS works for me with clang and the mingw64 headers to I assume that it is
> ready within LLVM.
> I have just submitted a patch to llvm maillist from kai of redstar.de for
> the seh that I updated to work on llvm-head.
>
> With regard to the _WIN32 ifdefs a sysroot mingw32 compiler should never
> be generated on windows because that is the native platform.
> We have all switched from doing that over at the mingw64 camp.
>
> In the patch I have removed the Generic_GCC toolchain and replaced it
> with the MINGW Driver.
>
> @@ -1967,10 +1970,7 @@
>        case llvm::Triple::GNU:
>          // FIXME: We need a MinGW toolchain.  Use the default Generic_GCC
>          // toolchain for now as the default case would below otherwise.
> -        if (Target.isOSBinFormatELF())
> -          TC = new toolchains::Generic_ELF(*this, Target, Args);
> -        else
> -          TC = new toolchains::Generic_GCC(*this, Target, Args);
> +        TC = new toolchains::MinGW(*this, Target, Args);
>
> Many Thanks
> Martell
>
>
>
> On Tue, Apr 15, 2014 at 7:51 PM, Reid Kleckner <rnk at google.com> wrote:
>
>> For TLS, that seems fine to commit after the LLVM TLS changes land.  Or
>> is LLVM already ready?
>>
>>  Ditto for SEH.  It should land when LLVM is ready.  Otherwise I don't
>> think it's interesting.
>>
>> The toolchain one is interesting, and is closest to ready to land.  I
>> don't think the _WIN32 ifdefs are correct.  On all platforms, we should use
>> the sysroot if provided and search relative to the clang binary if not.
>>
>> I'm not sure if the Generic_GCC toolchain is helpful here, but there
>> might be some gcc detection logic there that's worth reusing.
>>
>>
>> On Tue, Apr 15, 2014 at 11:42 AM, Yaron Keren <yaron.keren at gmail.com>wrote:
>>
>>> Hi Martell,
>>>
>>> For SEH support, the patch by Kai Nacke (
>>> http://wiki.dlang.org/Building_and_hacking_LDC_on_Windows_using_MSVC )
>>> should also be required, not?
>>>
>>> Yaron
>>>
>>>
>>>
>>> 2014-04-15 21:32 GMT+03:00 Martell Malone <martellmalone at gmail.com>:
>>>
>>>> Hi
>>>>
>>>> This is my first time using a mailing list so bare with me please.
>>>>
>>>> Based on work done by ruben vb I have created a patch for clang that
>>>> will find the include directories for the new windows-gnu triplet.
>>>> I have also enabled TLS which mingw64 supports and the introduction of
>>>> SEH exceptions on the front end.
>>>>
>>>> A patch will also be sent to the llvm mailing list for the backend.
>>>>
>>>> Many Thanks
>>>> Martell
>>>>
>>>> _______________________________________________
>>>> cfe-commits mailing list
>>>> cfe-commits at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>>>
>>>>
>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140415/ab38cadc/attachment.html>


More information about the cfe-commits mailing list