[PATCH] Fix compilation with MinGW-w64 GCC 4.8.2 64-bit SEH

Yaron Keren yaron.keren at gmail.com
Tue Dec 17 05:53:02 PST 2013


Hi,

It looks like RtlAddFunctionTable and RtlDeleteFunctionTable with SEH /
Win64 are replacements for __register_frame and __deregister_frame with Dwarf
EH / Win32.

To make the JIT/MCJIT exceptions work on Win64 it will have to call these
functions with the dynamically-generated EH. Or use
RtlInstallFunctionTableCallback.

Yaron



2013/12/17 Kai Nacke <kai at redstar.de>

> Hi Yaron!
>
>
> On 17.12.2013 10:34, Yaron Keren wrote:
>
>> Hi Kai,
>>
>> Thanks for the updated patch.
>>
>> Another question, __register_frame and __deregister_frame are used with
>> JIT and MCJIT to dynamically (de)register generated code.
>>
>> Are these functions missing or not required: without these functions,
>> the gcc unwinder won't have the DWARF data for the dynamic code, so will
>> exceptions for dynamic-generated code still work? how?
>>
>
> I have no real knowledge of JIT/MCJIT so this my be wrong. My current
> understanding is that __register_frame and __deregister_frame are not
> required on Windows. To get exception handling working, you have to
> generate the UNWIND_INFO and call RtlAddFunctionTable to register and
> RtlDeleteFunctionTable to deregister the unwind information.
>
> Regards,
> Kai
>
>  Yaron
>>
>>
>>
>> 2013/12/17 Kai Nacke <kai at redstar.de <mailto:kai at redstar.de>>
>>
>>
>>     Hi Yaron!
>>
>>     I attach my current patch. This one is also available at
>>     http://redstar.de/ldc/win64eh___all_20131217.diff
>>     <http://redstar.de/ldc/win64eh_all_20131217.diff>. It supersedes all
>>
>>     the referenced source below.
>>     This patch is required to support SEH in LLVM. (The patch implements
>>     Dwarf EH on top of SEH like gcc 4.8.)
>>     I also attach clang.diff. This adds half of SEH support to clang.
>>     The required changes in the driver are still missing.
>>
>>     Regards,
>>     Kai
>>
>>
>>     On 17.12.2013 09:58, Yaron Keren wrote:
>>
>>         Hi Jonathan and Kai,
>>
>>         Committed patch in revision 197483.
>>
>>         Regarding SEH Win64 in LLVM/clang, between the patches...
>>
>>         http://redstar.de/ldc/win64eh___all_20131117.diff
>>         <http://redstar.de/ldc/win64eh_all_20131117.diff>
>>         http://lists.cs.uiuc.edu/__pipermail/llvm-commits/Week-__
>> of-Mon-20130909/188032.html
>>         <http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-
>> of-Mon-20130909/188032.html>
>>         http://lists.cs.uiuc.edu/__pipermail/llvm-commits/Week-__
>> of-Mon-20130909/188029.html
>>
>>         <http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-
>> of-Mon-20130909/188029.html>
>>
>>         what is required -
>>         to support SEH in LLVM?
>>         to support SEH in clang?
>>
>>         Yaron
>>
>>
>>
>>         2013/12/17 Yaron Keren <yaron.keren at gmail.com
>>         <mailto:yaron.keren at gmail.com>
>>         <mailto:yaron.keren at gmail.com <mailto:yaron.keren at gmail.com>>__>
>>
>>
>>
>>                 Committed revision 197483.
>>
>>         http://llvm-reviews.chandlerc.__com/D2378
>>         <http://llvm-reviews.chandlerc.com/D2378>
>>
>>
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131217/3696d9f1/attachment.html>


More information about the llvm-commits mailing list