From 753f0ba1e99ac8539211547b8151c6ec3816e819 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Tue, 1 Mar 2016 11:28:35 -0800 Subject: 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 --- glib-patches/osx-static-framework.patch | 31 +++++++++++++++++++++++++++++++ glib-patches/patchlist | 1 + glib/configure.ac | 4 ++-- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 glib-patches/osx-static-framework.patch 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 -- cgit v1.2.1