I've been trying to cross-compile gnustep-base for weeks now with mingw-w64 on an Arch Linux machine, but I'm getting stuck. I was able to compile libobjc2, and set up gnustep-make. For gnustep-make, I used the following configure command:
./configure --prefix=/opt/cross/windows/gnustep --host=x86_64-w64-mingw32 CC=clang CXX=clang++ CPPFLAGS=$CLANG_WIN64_XFLAGS --enable-objc-nonfragile-abi --with-layout=fhs --with-thread-lib=-lpthread
After tweaking the cross.config file in the root of the gnustep-base directory, I run configure
:
./configure --prefix=/opt/cross/windows/gnustep --host=x86_64-w64-mingw32 CC=clang CXX=clang++ CPPFLAGS=$CLANG_WIN64_XFLAGS --enable-nxconstantstring
CLANG_WIN64_XFLAGS
is defined as:
-target x86_64-w64-mingw32 -nostdinc -isystem /usr/lib/clang/3.6.0/include -isystem /usr/x86_64-w64-mingw32/include -isystem /usr/x86_64-w64-mingw32/include/c++/5.1.0 -isystem /usr/x86_64-w64-mingw32/include/c++/5.1.0/backward -isystem /usr/x86_64-w64-mingw32/include/c++/5.1.0/x86_64-w64-mingw32 -D_GNU_SOURCE=1
This error occurs after running make:
Making all for subproject Additions...
Linking subproject Additions...
obj/Additions.obj/GSTypeEncoding.c.o: file not recognized: File format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I made sure all old object files were removed by running git reset && git checkout . && git clean -fdx
, but I still get this error.
Has anyone tried building gnustep-base using mingw-w64 on Linux? Any help at all would be much appreciated.