[Top][All Lists]

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

Re: Building GNUstep for Windows using Clang

From: David Chisnall
Subject: Re: Building GNUstep for Windows using Clang
Date: Tue, 25 Feb 2020 18:22:35 +0000
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0


On 25/02/2020 16:55, Frederik Seiffert wrote:
Hi all,

I’m trying to build GNUstep for Windows using Clang and the 2.0 runtime ABI in order to have support for ARC and blocks, but I’m having some issues and general questions.

I’ve successfully built libobjc2 (as well as libdispatch) in a Visual Studio command prompt using CMake and clang-cl as recommended <> (i.e. not using MinGW). Should these DLLs link/work when building GNUstep using MSYS2/MinGW?

Yes, they're native Windows DLLs, they should work with any Windows program, irrespective of what other DLLs it links (e.g. cygwin / msys). Note that the v2 ABI now has native support for SEH, so if you want exception interop and you want MinGW, you will need the toolchain variant that uses SEH, not Itanium-style DWARF unwinding.

There is a bug somewhere in the SEH support that I need to look for. I suspect it is in clang - EH seems to fail with ARC and I think that it may be to do with the ARC calls not being correctly emitted in the funclet. Dustin is planning on looking at some of the Clang funclet issues.

For me, building GNUstep base in MSYS2/MinGW fails during configure. Using LLD it doesn’t find objc.dll ("unable to find library -lobjc"). Using Gold gives different errors ("unrecognized emulation i386pep" and others). I’ve verified the library search paths.

As I’m pretty new to MinGW on Windows any general pointers are also much appreciated.

To the best of my knowledge, WinObjC works in this configuration but I do not know of anyone who has tried GNUstep (though I have no reason to suppose it won't work).

Note that, on Windows, the linker does not need to find objc.dll, it needs to find objc.lib. You don't need objc.dll until you try to run a program (by default, Windows searches in the same folder as the .exe, so to run the tests CMake copies objc.dll into the Tests directory). The Gold error looks as if you may have a 32-bit version of the DLL and be using a 64-bit toolchain? WinObjC is not 64-bit clean, but GNUstep should be. The runtime builds in either configuration (see the CI scripts - we build and test both in CI).


reply via email to

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