GNOME Bugzilla – Bug 673312
Regression: undefined reference to g_win32_get_package_installation_subdirectory() on Win32
Last modified: 2014-01-19 22:28:24 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.
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.
Created attachment 211093 [details] [review] Patch against 2.32.0 (1/2)
Created attachment 211094 [details] [review] Patch against 2.32.0 (2/2)
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
<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...
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.
ok, moot point -> closing