|
From: | Frederik Seiffert |
Subject: | Re: Building GNUstep for Windows using Clang |
Date: | Thu, 26 Nov 2020 13:18:50 +0100 |
Hi all, I took another stab at building for Windows, and using a fresh MSYS2 installation and the latest dependencies and Clang version I was able to make a bit of progress and run into some new issues... After building libobjc2 in a Visual Studio prompt and getting Make to build (more on that below), I got Base building as well but it fails when linking:
These warnings (a couple pages of them) are probably harmless but maybe someone knows what they are about?
These were built as part of libobjc2 (encoding2.c), but they don’t seem to be exported in the DLL. Is encoding.h missing some export statements?
Not sure about these... I’d appreciate anyone’s thoughts on the above, but also this seems a lot further than what I got back in May when I tried last, so that’s very encouraging. Following all the steps to get to the point I’m at just for reference. 1. Install MSYS2 and dependencies pacman -S git make pkg-config libxml2-devel libxslt-devel libffi-devel libgnutls-devel icu-devel pacman -S mingw-w64-x86_64-pkg-config mingw-w64-x86_64-libxml2 mingw-w64-x86_64-libxslt mingw-w64-x86_64-libffi mingw-w64-x86_64-gnutls mingw-w64-x86_64-icu mingw-w64-x86_64-clang mingw-w64-x86_64-lld 2. Build libobjc2 in "x64 Native Tools Command Prompt for VS 2019" cmake .. -G Ninja -DTESTS=off -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH=C:\GNUstep\x64 -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang ninja install 3. Build GNUstep Make in MinGW64 prompt ./configure --prefix=/c/GNUstep/x64 --with-library-combo=ng-gnu-gnu --with-runtime-abi=gnustep-2.0 LDFLAGS="-fuse-ld=lld -L/c/GNUstep/x64/lib" CFLAGS="-I/c/GNUstep/x64/include" This required a couple tries to get all the config checks to pass. For some reason some of the checks don’t seem to search the prefix for libraries or headers, so I had to add -L and -I flags manually as well. Also I think using lld instead of ld is key. It still shows the following warning, which seems incorrect though as lld _is_ being used successfully for all linking: checking for an gnustep-2.0 ABI compatible linker... unlikely (GNU ld) configure: WARNING: The detected linker might not produce working Objective-C binaries using the gnustep-2.0 ABI. Consider using gold or LLD. Also it native exceptions are not recognized for some reason: checking whether the compiler supports native ObjC exceptions... no 4. Building GNUstep Base in MinGW64 prompt . /c/GNUstep/x64/share/GNUstep/Makefiles/GNUstep.sh cp /c/GNUstep/x64/lib/objc.dll . ./configure make The only important point here is to copy objc.dll into the source directory so that the config tests will find it when being run. Maybe configure should do that automatically? Thanks, Frederik |
[Prev in Thread] | Current Thread | [Next in Thread] |