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 673312 - Regression: undefined reference to g_win32_get_package_installation_subdirectory() on Win32
Regression: undefined reference to g_win32_get_package_installation_subdirect...
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: win32
2.32.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2012-04-01 19:05 UTC by John Lindgren
Modified: 2014-01-19 22:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch against 2.32.0 (1/2) (467 bytes, patch)
2012-04-01 20:53 UTC, John Lindgren
none Details | Review
Patch against 2.32.0 (2/2) (517 bytes, patch)
2012-04-01 20:54 UTC, John Lindgren
none Details | Review

Description John Lindgren 2012-04-01 19:05:22 UTC
While trying to build pkg-config on Win XP Pro, I get an error: undefined reference to g_win32_get_package_installation_subdirectory().

Back in 2004, in commit f8cd1aea9e6f07bac2827da6cb15fdca8c9471e6, g_win32_get_package_installation_subdirectory() was #defined to a new function g_win32_get_package_installation_subdirectory_utf8() in gwin32.h.  The old function g_win32_get_package_installation_subdirectory() was made a private symbol (that is, present in the DLL but not in the import library) so as to maintain DLL compatibility for existing programs while making it impossible for new programs to link to the symbol.

This worked fine until 2011, when, in commit b25177fc4f1aaa1daf27791982ecc5e001845d2c, the #define was wrongly removed for 32-bit systems.  Now it is impossible to build a program using g_win32_get_package_installation_subdirectory() on a 32-bit system because the linker cannot find the private symbol.
Comment 1 John Lindgren 2012-04-01 19:32:38 UTC
It appears that commit b25177fc4f1aaa1daf27791982ecc5e001845d2c was an attempt to fix a build error (redefinition of g_win32_get_package_installation_[sub]directory_utf8()) when G_DISABLE_DEPRECATED was *not* defined.

This build error was introduced in 2008 by commit e55fca9533b7cc6ada62fc1f51cf899b1dce7d8e, which wrongly removed two #undefs needed to implement the compatibility functions g_win32_get_package_installation_[sub]directory().

I believe the correct fix is to restore the two #defines removed in 2011 *and* the two #undefs removed in 2008.  Will test and report back if this works.
Comment 2 John Lindgren 2012-04-01 20:53:35 UTC
Created attachment 211093 [details] [review]
Patch against 2.32.0 (1/2)
Comment 3 John Lindgren 2012-04-01 20:54:02 UTC
Created attachment 211094 [details] [review]
Patch against 2.32.0 (2/2)
Comment 4 Olav Vitters 2012-07-31 22:49:18 UTC
From IRC

<dieterv> bkor: while the second bug might be valid in it's own right, pkg-config no longer uses g_win32_get_package_installation_subdirectory()
<dieterv> bkor: LRN fixed that in http://cgit.freedesktop.org/pkg-config/commit/?id=7ac6f32625254a14180677694a0a98d333fc5813
Comment 5 Olav Vitters 2012-07-31 22:51:36 UTC
<bkor> dieterv: not a dev, so no clue.. in my simple mind this might be abi issue?
<bkor> he cares about win32, which is awesome
<dieterv> bkor: not really, g_win32_get_package_installation_subdirectory() is simply deprecated
<dieterv> bkor: oh, I see, never ran into this due to bootstrapping my pkg-config build against an older glib 2.28 binary (due to circular deps)
<dieterv> bkor: I'll put it on my todo list, no promises on when though...
Comment 6 John Lindgren 2012-08-02 01:03:29 UTC
It's technically not an ABI break, since the symbol is still there in the DLL for existing programs to use.  The problem is when you try to compile and link source code using the function, because it's not in the import library.  Anyway, I guess it's a moot point since the function is deprecated and pkg-config has been updated to avoid using it now.
Comment 7 Matthias Clasen 2014-01-19 22:28:24 UTC
ok, moot point -> closing