GNOME Bugzilla – Bug 642214
GTK+ 3.0 fails to compile caused by linking with libuuid.a via libtool in Windows hosts
Last modified: 2011-05-05 14:37:31 UTC
Created attachment 180763 [details] [review] Patch for GTK+ 3 to link libuuid using linker instead of passing to libtool libgtk-3-0.dll fails to compile for Windows hosts because libuuid is linked using libtool instead of passing it to the linker. Libtool only accepts import libraries for shared libraries, while libuuid is a static library in Windows. Error from libtool: *** Warning: linker path does not have real file for library -luuid. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because I did check the linker path looking for a file starting *** with libuuid and none of the candidates passed a file format test *** using a file magic. Last file checked: /usr/i586-mingw32msvc/lib/libuuid.a *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it. Removing "-luuid" from libgtk_3_la_LIBADD then adding "-Wl,-luuid" to libgtk_3_la_LDFLAGS when compiling for Windows hosts solves the problem. A patch is attached to do this.
Thanks for the patch, Arnel. Looks like it's a regression introduced in http://git.gnome.org/browse/gtk+/commit/?id=07d49ee56a4ce86d9d6154e00ff6b10bd3bdc2a4
Created attachment 186959 [details] [review] Bypass libtool for linking with libuuid on win32 Arnel Borja's patch formatted with git-format-patch for easy applying. I also edited the patch slightly to also remove the commented out #libgtk_win32_3_la_LDFLAGS = $(libtool_opts) -Wl,-luuid line which was commented out in 07d49ee5 when all the backend libraries were merged into libgtk.
Review of attachment 186959 [details] [review]: Looks correct to me as far as we're fixing the regression; the old code definitely used the -Wl,-luuid trick. I'm surprised that libtool doesn't have a mechanism for doing what you want though.
Attachment 186959 [details] pushed as c064808 - Bypass libtool for linking with libuuid on win32
*** Bug 648975 has been marked as a duplicate of this bug. ***