diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2016-03-01 11:28:35 -0800 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2016-03-01 11:28:35 -0800 |
commit | 753f0ba1e99ac8539211547b8151c6ec3816e819 (patch) | |
tree | 93caefc4cb6917367626ee683953940c2661ad12 | |
parent | 5164b9dbabdca00fbd9d6bb962c4ac9b252448a2 (diff) |
glib: Fix OSX build with internal glib
In the last internal glib update, the glib configure script changed the
OSX framework flags from the form of "-framework Foo" to
"-Wl,framework,Foo". Unfortunately, libtool only understands the prior
form and doesn't include the appropriate -framework flags in the
libglib-2.0.la file. This ultimately causes pkg-config to fail to link
properly:
Undefined symbols for architecture x86_64:
"_CFRelease", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_CFStringGetCString", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_CFStringGetCStringPtr", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_CFStringGetLength", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_CFURLCopyFileSystemPath", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_CFURLCreateFromFSRef", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_FSFindFolder", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_kCFAllocatorSystemDefault", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
ld: symbol(s) not found for architecture x86_64
Upstream has fixed this by including the new style -framework flags in
the glib-2.0.pc file. We can't use that here as we're bootstrapping
pkg-config itself. Rather than work around this with an OSX platform
check in pkg-config's configure, carry a downstream patch to revert
glib's configure to using the old format.
https://bugs.freedesktop.org/show_bug.cgi?id=92902
-rw-r--r-- | glib-patches/osx-static-framework.patch | 31 | ||||
-rw-r--r-- | glib-patches/patchlist | 1 | ||||
-rw-r--r-- | glib/configure.ac | 4 |
3 files changed, 34 insertions, 2 deletions
diff --git a/glib-patches/osx-static-framework.patch b/glib-patches/osx-static-framework.patch new file mode 100644 index 0000000..b059f2e --- /dev/null +++ b/glib-patches/osx-static-framework.patch @@ -0,0 +1,31 @@ +glib's configure changed to using the single form -Wl,-framework,Foo +format, but that means that libtool won't include the flags in the .la +file and won't get used when linking pkg-config. That breaks use of the +static internal glib on OSX. + +Upstream this was handled by adding those flags to glib's .pc file. We +can't use that while bootstrapping pkg-config, so just revert to the +previous format downstream. + +https://bugs.freedesktop.org/show_bug.cgi?id=92902 +https://bugzilla.gnome.org/show_bug.cgi?id=566994 + +diff --git a/glib/configure.ac b/glib/configure.ac +index ffa7869..4ace471 100644 +--- a/glib/configure.ac ++++ b/glib/configure.ac +@@ -224,12 +224,12 @@ AM_CONDITIONAL(MS_LIB_AVAILABLE, [test x$ms_librarian = xyes]) + + AS_IF([test "x$glib_have_carbon" = "xyes"], [ + AC_DEFINE(HAVE_CARBON, 1, [define to 1 if Carbon is available]) +- LDFLAGS="$LDFLAGS -Wl,-framework,Carbon" ++ LDFLAGS="$LDFLAGS -framework Carbon" + ]) + + if test "x$glib_have_cocoa" = "xyes"; then + AC_DEFINE(HAVE_COCOA, 1, [define to 1 if Cocoa is available]) +- LDFLAGS="$LDFLAGS -Wl,-framework,Foundation" ++ LDFLAGS="$LDFLAGS -framework Foundation" + fi + + dnl declare --enable-* args and collect ac_help strings diff --git a/glib-patches/patchlist b/glib-patches/patchlist index 52bb331..e186f38 100644 --- a/glib-patches/patchlist +++ b/glib-patches/patchlist @@ -7,3 +7,4 @@ no-gettext.patch cross-compiling.patch static-only.patch win32-static-init.patch +osx-static-framework.patch diff --git a/glib/configure.ac b/glib/configure.ac index ffa7869..4ace471 100644 --- a/glib/configure.ac +++ b/glib/configure.ac @@ -224,12 +224,12 @@ AM_CONDITIONAL(MS_LIB_AVAILABLE, [test x$ms_librarian = xyes]) AS_IF([test "x$glib_have_carbon" = "xyes"], [ AC_DEFINE(HAVE_CARBON, 1, [define to 1 if Carbon is available]) - LDFLAGS="$LDFLAGS -Wl,-framework,Carbon" + LDFLAGS="$LDFLAGS -framework Carbon" ]) if test "x$glib_have_cocoa" = "xyes"; then AC_DEFINE(HAVE_COCOA, 1, [define to 1 if Cocoa is available]) - LDFLAGS="$LDFLAGS -Wl,-framework,Foundation" + LDFLAGS="$LDFLAGS -framework Foundation" fi dnl declare --enable-* args and collect ac_help strings |