After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 684145 - Current Git sources fails to cross-compile for Windows in Linux using MinGW-64
Current Git sources fails to cross-compile for Windows in Linux using MinGW-64
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: win32
2.33.x
Other Windows
: Normal critical
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-16 11:26 UTC by Arnel Borja
Modified: 2012-12-02 19:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patches to cross-compile for Windows in Linux (3.62 KB, patch)
2012-09-16 11:26 UTC, Arnel Borja
none Details | Review

Description Arnel Borja 2012-09-16 11:26:40 UTC
Created attachment 224442 [details] [review]
Patches to cross-compile for Windows in Linux

Current Git sources fails to compile in Windows because of the following:
- Unix functions in 2 GIO tests (one introduced from patches of bgo#674805 [commits 0149f44f and 375943ea])
- Unimplemented method for Windows in GContentType, added from a bug reports (bgo#683744 [commit cc3238a9])
- Use of dlltool, without prefix of host type

To fix them, I created patches that will:
- Compile the 2 GIO tests that use Unix functions only when compiling for Unix
- Stub for the unimplemented GContentType method, which are not applicable to Windows anyway (since usually its a file name of an executable, set in the registry), returning NULL, though please check
- Use AC_CHECK_TOOL in configure.ac to find dlltool

Adding the patch from bgo#683642, GLib should now compile.

I merged the 4 commits into 1 patch file.

Some of compile errors and warnings:
------------------------------------------------------------
cd .. && /bin/bash ./config.status gio/gio.rc
config.status: creating gio/gio.rc
i686-w64-mingw32-windres gio.rc gio-win32-res.o
  GEN    gio.def
  CCLD   libgio-2.0.la
Creating library file: .libs/libgio-2.0.dll.a
Cannot export g_content_type_get_generic_icon_name: symbol not defined
collect2: ld returned 1 exit status
make[4]: *** [libgio-2.0.la] Error 1
make[4]: Leaving directory `/mnt/precise/kyoushuu/Devel/MinGW/glib/gio'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/mnt/precise/kyoushuu/Devel/MinGW/glib/gio'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/mnt/precise/kyoushuu/Devel/MinGW/glib/gio'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/precise/kyoushuu/Devel/MinGW/glib'
make: *** [all] Error 2
------------------------------------------------------------
  CC     gdbus-proxy.o
gdbus-proxy.c: In function ‘kill_test_service’:
gdbus-proxy.c:756:3: warning: implicit declaration of function ‘kill’ [-Wimplicit-function-declaration]
  CCLD   gdbus-proxy.exe
gdbus-proxy.o:gdbus-proxy.c:(.text+0x2ca9): undefined reference to `_kill'
collect2: ld returned 1 exit status
make[6]: *** [gdbus-proxy.exe] Error 1
make[6]: Leaving directory `/mnt/precise/kyoushuu/Devel/MinGW/glib/gio/tests'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/mnt/precise/kyoushuu/Devel/MinGW/glib/gio/tests'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/mnt/precise/kyoushuu/Devel/MinGW/glib/gio/tests'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/mnt/precise/kyoushuu/Devel/MinGW/glib/gio'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/mnt/precise/kyoushuu/Devel/MinGW/glib/gio'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/precise/kyoushuu/Devel/MinGW/glib'
make: *** [all] Error 2
------------------------------------------------------------
make[6]: Entering directory `/mnt/precise/kyoushuu/Devel/MinGW/glib/gio/tests'
  CC     appinfo-test.o
appinfo-test.c: In function ‘main’:
appinfo-test.c:13:3: warning: implicit declaration of function ‘getpid’ [-Wimplicit-function-declaration]
  CCLD   appinfo-test.exe
------------------------------------------------------------
[[Another one saying dlltool is not found]]
Comment 1 Kalev Lember 2012-12-02 19:14:16 UTC
Hi Arnel,

Thanks for the patches and sorry they've lingered here for so long.


(In reply to comment #0)
> - Compile the 2 GIO tests that use Unix functions only when compiling for Unix

Dan Windship has already fixed gdbus-proxy test to compile in commit d9e8feae7cb60e2e2cb62f0a948f025c09ca8553 and moved appinfo-test to the unix-only section in commit f248c86b0aac6c64bd2cb8e2a0e8814719a4bb0a (https://bugzilla.gnome.org/show_bug.cgi?id=688109).

> - Stub for the unimplemented GContentType method, which are not applicable to
> Windows anyway (since usually its a file name of an executable, set in the
> registry), returning NULL, though please check

Has been already fixed that way, returning NULL. commit dace477c92ea3a9111cef73159a6a1fcaaf0f497


> - Use AC_CHECK_TOOL in configure.ac to find dlltool

Pushed to master as 4a506290a701a890b4609ac979f8e1d11935a39e


> Adding the patch from bgo#683642, GLib should now compile.
> 
> I merged the 4 commits into 1 patch file.

Separate attachments would actually be easier next time, because that way it's easier to review them (and mark as reviewed in bugzilla) separately.

Thanks!