gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: win32 show-stoppers


From: Hovik Melikyan
Subject: Re: win32 show-stoppers
Date: Fri, 2 Jan 2015 13:01:10 +0000

> Thanks.  Is there any chance you can put this on github (create a branch and 
> rebase squashing everything into a single commit) for easier review?

https://github.com/crontab/libobjc2/tree/mingw

>
> That's an easy change to make, but I'm not overly familiar with the MinGW 
> unwinder, but I think we need to write a _seh variant of the personality 
> function.  There's already an abstraction layer to paper over the differences 
> between the Itanium and ARM EH ABIs, so this ought to be extensible to add 
> SEH support.
>

Just tried clang++ (even upgraded it to the latest trunk) and no, it
still emits __gxx_personality_v0, which is not available in 64-bit
libgcc. The Internet says implementing 64-bit Dwarf2 exceptions would
be a lot of non-trivial work, so there is little hope.

Which leaves two options: SjLj and SEH. Both seem to be available in
libgcc (though binary distributions usually come with only one of
them). SEH is preferred as it's faster and also guarantees
interoperability with MSVC-built dynamic libraries, including system
ones, whereas SjLj is slower and will likely crash in "foreign" DLLs.
Probably not a major show stopper, but still. Will look into clang
sources to see what can be done.

--
H.M.


On Fri, Jan 2, 2015 at 9:33 AM, David Chisnall <address@hidden> wrote:
> On 2 Jan 2015, at 03:39, Hovik Melikyan <address@hidden> wrote:
>>
>> The attached patch completes the MinGW 32-bit port, plus it has some
>> bits for MinGW 64-bit and also some trivial fixes for OS X 32-bit.
>
> Thanks.  Is there any chance you can put this on github (create a branch and 
> rebase squashing everything into a single commit) for easier review?
>
>>
>> The weak linking problem is solved by walking through the loaded DLLs
>> at run time. This is done only once upon the first call to
>> __cxa_begin_catch.
>
> It probably belongs in the objc load function, so we avoid a conditional on 
> every catch.
>
>> The story with MinGW64 is this: I have the impression clang is not
>> quite ready yet. Unfortunately my knowledge of EH personality stuff is
>> virtually zero, but as I understand it, the fact that clang emits
>> __gcc_personality_v0 (i.e. Dwarf2 model) on MinGW64 is just not right.
>> The SEH patent has expired and there is mentioning on the internet
>> that some work on llvm/clang is underway, but in any case it doesn't
>> work out of the box. Unless of course I'm missing something.
>
> That's an easy change to make, but I'm not overly familiar with the MinGW 
> unwinder, but I think we need to write a _seh variant of the personality 
> function.  There's already an abstraction layer to paper over the differences 
> between the Itanium and ARM EH ABIs, so this ought to be extensible to add 
> SEH support.
>
> I don't recall if the support in LLVM is actually for SEH or for the Win64 
> exceptions.  Can you see if exceptions work correctly with C++ and clang on 
> Windows?  If so, then it should be easy to add the missing Objective-C parts.
>
>> (In the meantime I have also ported GNUstep Base and packaged it
>> together with libobjc2 into something I call Subjective:
>> https://github.com/crontab/Subjective The idea is that you can have
>> non-GUI runtime for Objective-C on WIndows and that you don't need the
>> (overengineered) GNUstep build system for building it; simple
>> makefiles are provided instead.)
>
> I find the GNUstep build system incredibly annoying and would love to see it 
> use CMake so that I can generate XCode projects when I'm on a Mac or Ninja 
> files for *NIX.
>
> David
>
> -- Send from my Jacquard Loom
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]