Building 64-bit on Windows

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Building 64-bit on Windows

Sam Izzo
Hi,

I would like to use GNUstep to build a 64-bit DLL from some Obj-C code.
I then want to use the DLL in Unity. The Windows installer on the
download page seems quite old and doesn't have a 64-bit compiler or
64-bit libobjc as far as I can tell. I've tried to build everything from
scratch in msys2 with clang but haven't been successful. I can detail
the problems I've had and exactly what I've tried if that would help
(I'll just have to run through it all again and make notes).

Is this possible?

Thanks,
Sam


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: Building 64-bit on Windows

Riccardo Mottola-5
Hei Sam,

Sam Izzo wrote:
> Hi,
>
> I would like to use GNUstep to build a 64-bit DLL from some Obj-C
> code. I then want to use the DLL in Unity. The Windows installer on
> the download page seems quite old and doesn't have a 64-bit compiler
> or 64-bit libobjc as far as I can tell. I've tried to build everything
> from scratch in msys2 with clang but haven't been successful. I can
> detail

It is based on an older mingw environment and I am having big
difficulties upgrading it, still in the realm of remaining on mingw
32bit and gcc (no libobjc2)

> the problems I've had and exactly what I've tried if that would help
> (I'll just have to run through it all again and make notes).
>
> Is this possible?

I have been exploring the path of msys2 (although with gcc and its
runtime, nto clang+libobjc2) too: ideally I'd like to have both
alternatives available for the time being, but I was unable to. I have
other big difficulties.
I can't even compile base, issues with winsock and such.

Sorry not being able to help you further, few people work on Win support
at all.

Riccardo


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: Building 64-bit on Windows

David Chisnall-7
On 29/10/2018 14:59, Riccardo Mottola wrote:
> It is based on an older mingw environment and I am having big
> difficulties upgrading it, still in the realm of remaining on mingw
> 32bit and gcc (no libobjc2)

For anyone interested in the libobjc2 status:

libobjc2 with the new ABI does not yet handle DLLs on Windows properly.
Windows DLLs provide some cleaner abstractions than *NIX shared objects,
but this means a global variable in one DLL cannot be initialised to
point to globals in another.  We have been working on some solutions to
this, and I think it's now sensible, but we haven't yet upstreamed the
changes to clang.  Once this is done, we should be able to ship a
libobjc.dll as a pure Windows DLL, useable by both WinObjC and GNUstep
with either Cygwin or MinGW.  The new ABI uses Windows-compatible
exception handling, so it's safe to mix Visual Studio-compiled C++ code
with Objective-C and throw exceptions between languages.

I hope to get this all done, tested, and upstreamed before the LLVM 8.0
release.

David

_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: Building 64-bit on Windows

Sam Izzo
In reply to this post by Riccardo Mottola-5
Hi Riccardo,

On 30/10/2018 1:59 AM, Riccardo Mottola wrote:
> Sorry not being able to help you further, few people work on Win
> support at all.

Thanks for your reply. I had seen some posts in the archives of the
mailing list that made it sound like it was possible but I guess based
on what you and David have written it's currently not possible to
generate a 64-bit executable/DLL. I think for our project we'll have to
go down the more painful path which is to convert all the Obj-C code to C#!

Thanks,
Sam


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: Building 64-bit on Windows

Fred Kiefer

> Am 29.10.2018 um 22:26 schrieb Sam Izzo <[hidden email]>:
> Thanks for your reply. I had seen some posts in the archives of the mailing list that made it sound like it was possible but I guess based on what you and David have written it's currently not possible to generate a 64-bit executable/DLL. I think for our project we'll have to go down the more painful path which is to convert all the Obj-C code to C#!


There is a script in the GNUstep repository to set up a WIn64 environment to compile GNUstep https://github.com/gnustep/tools-scripts/blob/master/install-dependencies-msys2-64bit
But as I don’t use Windows myself I am unsure whether that actually works or not.

Cheers,
Fred
_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: Building 64-bit on Windows

Riccardo Mottola-5
In reply to this post by Sam Izzo
Hi,

Sam Izzo wrote:
>
> Thanks for your reply. I had seen some posts in the archives of the
> mailing list that made it sound like it was possible but I guess based
> on what you and David have written it's currently not possible to
> generate a 64-bit executable/DLL. I think for our project we'll have to
> go down the more painful path which is to convert all the Obj-C code to C#!

well, before jumping to conclusions....  since rewriting everything
sounds like a lot of work.

Do you really need libobjc2 or is your code fine with GCC runtime?
Would it be easier to convert it to GNU runtime instead of rewriting it?

Second, do you really need 64bit?

the
supplied installer works and is "proven". It is relatively easily to
update some of its dependencies and then upgrade gnustep core "in place"
and get a current gnustep installation. I was unable to repackage this
work, otherwise I would have distributed it.

I have read here that people got gnustep to run on MinGW64 - there were
some earlier post and commits. I Attempted but failed, the issue might
be on my side. I haven't thrown the towel, but unfortunately even if
there is demand for GNUstep on windows, I'm almost alone there, so don't
hold your breath, you would choke.

Cheers,

Riccardo

_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: Building 64-bit on Windows

Sam Izzo
Hey Riccardo,

On 30/10/2018 10:30 AM, Riccardo Mottola wrote:
> Do you really need libobjc2 or is your code fine with GCC runtime?
> Would it be easier to convert it to GNU runtime instead of rewriting it?
>
> Second, do you really need 64bit?
I definitely need 64-bit. I'll give you a bit more information about
what I'm trying to do. We have a game which has been built in
Objective-C for iOS using Interface Builder. We want to port it to the
Unity game engine so we can target Windows. The UI will be entirely
rebuilt in Unity and we want to compile as much of the existing Obj-C
code into a DLL as we can. The code is fairly cleanly split into game
code and UI code so this shouldn't be too much work. The Unity editor
and engine uses C# for game code but can load native DLLs and access
them with P/Invoke. However, although the editor can build games out to
32-bit executables, the editor itself is 64-bit, so we need a 64-bit
version of the DLL so we can actually test the game in the editor for
faster iteration. Unity stopped supporting the 32-bit editor quite a few
revisions ago now and we don't want to use an old version of Unity.

So our idea is that we would build the Objective-C code into a DLL and
then expose it via a C interface to C#. The game would then ship with
that DLL (and any dependencies obviously like libobjc2) and we should be
able to also iterate in the editor as well.

If the gcc runtime can be used to build 64-bit then maybe we can use it.
I haven't investigated that though - we were trying to build with clang
since the code is fairly modern Obj-C and uses some features that didn't
seem to be in gcc (or at least the gcc that shipped with the installer)
like generics.

> the
> supplied installer works and is "proven". It is relatively easily to
> update some of its dependencies and then upgrade gnustep core "in
> place" and get a current gnustep installation. I was unable to
> repackage this work, otherwise I would have distributed it.
>
> I have read here that people got gnustep to run on MinGW64 - there
> were some earlier post and commits. I Attempted but failed, the issue
> might be on my side. I haven't thrown the towel, but unfortunately
> even if there is demand for GNUstep on windows, I'm almost alone
> there, so don't hold your breath, you would choke.
>
Thanks, I saw some posts about that. Maybe I should try again!

Cheers,
Sam


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: Building 64-bit on Windows

Richard Frith-Macdonald-9
In reply to this post by Fred Kiefer
> On 29 Oct 2018, at 22:26, Fred Kiefer <[hidden email]> wrote:
>
>
>> Am 29.10.2018 um 22:26 schrieb Sam Izzo <[hidden email]>:
>> Thanks for your reply. I had seen some posts in the archives of the mailing list that made it sound like it was possible but I guess based on what you and David have written it's currently not possible to generate a 64-bit executable/DLL. I think for our project we'll have to go down the more painful path which is to convert all the Obj-C code to C#!
>
>
> There is a script in the GNUstep repository to set up a WIn64 environment to compile GNUstep https://github.com/gnustep/tools-scripts/blob/master/install-dependencies-msys2-64bit
> But as I don’t use Windows myself I am unsure whether that actually works or not.

It did last time I used it (many months ago).  Generally there should be no problem using a 64bit environment if you use gcc and the traditional ObjC runtime.
It's buildinga 'next gen' setup, using clang and the new libobjc2 runtime, that's not quite there yet.
_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep