GNOME Bugzilla – Bug 776219
Target lower than 10.9 specified in setup_sdk() fails to build
Last modified: 2016-12-18 22:35:11 UTC
When building on OS X 12.12 with setup_sdk() target set to lower than 10.9, I get CCLD _giscanner.la CCLD libgirepository-internals.la libtool: link: Waiting for /Users/jhbuild/gtk/source/gobject-introspection-1.48.0/./.libs/libgirepository-gthash.a.lock to be removed GEN g-ir-scanner GEN g-ir-annotation-tool CCLD g-ir-generate CCLD glib-print CCLD g-ir-compiler GICOMP gir/DBus-1.0.gir GICOMP gir/fontconfig-2.0.gir GICOMP gir/freetype2-2.0.gir GICOMP gir/GL-1.0.gir GICOMP gir/libxml2-2.0.gir GICOMP gir/xft-2.0.gir GICOMP gir/xlib-2.0.gir GICOMP gir/xfixes-4.0.gir GISCAN GLib-2.0.gir dyld: lazy symbol binding faileddyld: lazy symbol binding failed: Symbol not found: _g_cocoa_not: Symbol not found: _g_cocoa_notification_backend_get_type Refification_backend_get_type Referenced from: /Users/jhbuild/gtkerenced from: /Users/jhbuild/gtk/inst/lib/libgio-2.0.0.dylib E/inst/lib/libgio-2.0.0.dylib Edyld: lazy symbol binding failedxpected in: flat namespace xpected in: flat namespace : Symbol not found: _g_cocoa_notification_backend_get_type Refdyld: lazy symbol binding faileddyld: Symbol not found: _g_cocoaerenced from: /Users/jhbuild/gtk: Symbol not found: _g_cocoa_notdyld: Symbol not found: _g_cocoa/inst/lib/libgio-2.0.0.dylib E_notification_backend_get_type _notification_backend_get_type ification_backend_get_type Refxpected in: flat namespace Referenced from: /Users/jhbuild Referenced from: /Users/jhbuilderenced from: /Users/jhbuild/gtk/gtk/inst/lib/libgio-2.0.0.dylib/gtk/inst/lib/libgio-2.0.0.dylibdyld: Symbol not found: _g_cocoa Expected in: flat namespace _notification_backend_get_type dyld: lazy symbol binding failed/inst/lib/libgio-2.0.0.dylib E: Symbol not found: _g_cocoa_not Referenced from: /Users/jhbuildification_backend_get_type Ref/gtk/inst/lib/libgio-2.0.0.dylibxpected in: flat namespace erenced from: /Users/jhbuild/gtk Expected in: flat namespace /inst/lib/libgio-2.0.0.dylib Expected in: flat namespace dyld: Symbol not found: _g_cocoa_notification_backend_get_type Expected in: flat namespace Referenced from: /Users/jhbuilddyld: lazy symbol binding failed/gtk/inst/lib/libgio-2.0.0.dylibdyld: Symbol not found: _g_cocoa Expected in: flat namespace _notification_backend_get_type Referenced from: /Users/jhbuild: Symbol not found: _g_cocoa_not/gtk/inst/lib/libgio-2.0.0.dylibification_backend_get_type Ref Expected in: flat namespace erenced from: /Users/jhbuild/gtk/inst/lib/libgio-2.0.0.dylib Expected in: flat namespace dyld: Symbol not found: _g_cocoa_notification_backend_get_type Referenced from: /Users/jhbuilddyld: lazy symbol binding faileddyld: lazy symbol binding failed/gtk/inst/lib/libgio-2.0.0.dylib Expected in: flat namespace : Symbol not found: _g_cocoa_not: Symbol not found: _g_cocoa_notification_backend_get_type Refification_backend_get_type Referenced from: /Users/jhbuild/gtkerenced from: /Users/jhbuild/gtk/inst/lib/libgio-2.0.0.dylib E/inst/lib/libgio-2.0.0.dylib Expected in: flat namespace xpected in: flat namespace dyld: Symbol not found: _g_cocoadyld: Symbol not found: _g_cocoa_notification_backend_get_type _notification_backend_get_type Referenced from: /Users/jhbuild Referenced from: /Users/jhbuild/gtk/inst/lib/libgio-2.0.0.dylib/gtk/inst/lib/libgio-2.0.0.dylib Expected in: flat namespace Expected in: flat namespace /Users/jhbuild/gtk/inst/bin/bash: r'adek 1: 52721 Abort trap: 6 env PATH=".libs:/Users/jhbuild/gtk/inst/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/jhbuild/.local/bin" ./g-ir-compiler --includedir=. --includedir=./gir --includedir=. --includedir=. --includedir=./gir --includedir=. gir/xlib-2.0.gir -o gir/xlib-2.0.typelib /Users/jhbuild/gtk/inst/bin/bash: r'adek 1: 52718 Abort trap: 6 env PATH=".libs:/Users/jhbuild/gtk/inst/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/jhbuild/.local/bin" ./g-ir-compiler --includedir=. --includedir=./gir --includedir=. --includedir=. --includedir=./gir --includedir=. gir/libxml2-2.0.gir -o gir/libxml2-2.0.typelib /Users/jhbuild/gtk/inst/bin/bash: r'adek 1: 52716 Abort trap: 6 env PATH=".libs:/Users/jhbuild/gtk/inst/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/jhbuild/.local/bin" ./g-ir-compiler --includedir=. --includedir=./gir --includedir=. --includedir=. --includedir=./gir --includedir=. gir/freetype2-2.0.gir -o gir/freetype2-2.0.typelib /Users/jhbuild/gtk/inst/bin/bash: r'adek 1: 52722 Abort trap: 6 env PATH=".libs:/Users/jhbuild/gtk/inst/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/jhbuild/.local/bin" ./g-ir-compiler --includedir=. --includedir=./gir --includedir=. --includedir=. --includedir=./gir --includedir=. gir/xfixes-4.0.gir -o gir/xfixes-4.0.typelib /Users/jhbuild/gtk/inst/bin/bash: r'adek 1: 52713 Abort trap: 6 env PATH=".libs:/Users/jhbuild/gtk/inst/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/jhbuild/.local/bin" ./g-ir-compiler --includedir=. --includedir=./gir --includedir=. --includedir=. --includedir=./gir --includedir=. gir/DBus-1.0.gir -o gir/DBus-1.0.typelib /Users/jhbuild/gtk/inst/bin/bash: r'adek 1: 52717 Abort trap: 6 env PATH=".libs:/Users/jhbuild/gtk/inst/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/jhbuild/.local/bin" /Users/jhbuild/gtk/inst/bin/bash: r'adek 1: 52714 Abort trap: 6 env PATH=".libs:/Users/jhbuild/gtk/inst/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/jhbuild/.local/bin" ./g-ir-compiler --includedir=. --includedir=./gir --includedir=. --includedir=. --includedir=./gir --includedir=. gir/fontconfig-2.0.gir -o gir/fontconfig-2.0.typelib ./g-ir-compiler --includedir=. --includedir=./gir --includedir=. --includedir=. --includedir=./gir --includedir=. gir/GL-1.0.gir -o gir/GL-1.0.typelib /Users/jhbuild/gtk/inst/bin/bash: r'adek 1: 52720 Abort trap: 6 env PATH=".libs:/Users/jhbuild/gtk/inst/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/jhbuild/.local/bin" ./g-ir-compiler --includedir=. --includedir=./gir --includedir=. --includedir=. --includedir=./gir --includedir=. gir/xft-2.0.gir -o gir/xft-2.0.typelib make[2]: *** [gir/xlib-2.0.typelib] Error 134 make[2]: *** Waiting for unfinished jobs.... make[2]: *** [gir/xfixes-4.0.typelib] Error 134 make[2]: *** [gir/libxml2-2.0.typelib] Error 134 make[2]: *** [gir/freetype2-2.0.typelib] Error 134 make[2]: *** [gir/DBus-1.0.typelib] Error 134 make[2]: *** [gir/GL-1.0.typelib] Error 134 make[2]: *** [gir/fontconfig-2.0.typelib] Error 134 make[2]: *** [gir/xft-2.0.typelib] Error 134 Traceback (most recent call last):
+ Trace 236993
from giscanner.scannermain import scanner_main
from giscanner.dumper import compile_introspection_binary
from .gdumpparser import IntrospectionBinary
from .transformer import TransformerException
from .girparser import GIRParser
from .girwriter import COMPATIBLE_GIR_VERSION
from .xmlwriter import XMLWriter
from _giscanner import collect_attributes
mod = imp.load_module(name, open(realpath), realpath, suffix)
Referenced from: /Users/jhbuild/gtk/inst/lib/libgio-2.0.0.dylib Expected in: flat namespace in /Users/jhbuild/gtk/inst/lib/libgio-2.0.0.dylib make[2]: *** [GLib-2.0.gir] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 *** Error during phase build of gobject-introspection: ########## Error running make -j 9 *** [8/14] when gobject-introspection starts getting built (glib itself compiles fine). I believe the problem is in the patch here https://github.com/jralls/gtk-osx-build/blob/master/patches/0001-Bug747146-Build-cocoanotification-only-if-supported.patch The macro MAC_OS_X_9 is determined based on which system I'm building on, which is 12.12 so it's defined and gcocoanotificationbackend.c gets built. However, AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER is based on what's set to -mmacosx-version-min=, which is the target value and which is the value lower than 10.9 so the portion of giomodule.c doesn't get built.
What's the SDK argument to setup_sdk()? What happens if you change the AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER to MAC_OS_X_9 in giomodule.c?
(In reply to John Ralls from comment #1) > What's the SDK argument to setup_sdk()? The problem appears when there's anything below 10.9 (e.g. 10.8 or 10.7). > What happens if you change the AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER to > MAC_OS_X_9 in giomodule.c? Will try.
> What's the SDK argument to setup_sdk()? Oh sorry, the above was "target". The whole setup_sdk() is setup_sdk(target="10.7", sdk_version="native", architectures=[_default_arch])
> The macro MAC_OS_X_9 is determined based on which system I'm building on, which is 12.12 so it's defined and gcocoanotificationbackend.c gets built. However, AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER is based on what's set to -mmacosx-version-min=, which is the target value and which is the value lower than 10.9 so the portion of giomodule.c doesn't get built. Eh, no. Now looking at https://opensource.apple.com/source/xnu/xnu-2422.90.20/EXTERNAL_HEADERS/AvailabilityMacros.h the problem is that AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER is used incorrectly - it's supposed to be an attribute specified behind a function and say from which version the given function is available. It's not supposed to be tested by #ifdef as used in gio/giomodule.c because it's defined also in other cases: #if __AVAILABILITY_MACROS_USES_AVAILABILITY #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_4_0) #elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER UNAVAILABLE_ATTRIBUTE #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER WEAK_IMPORT_ATTRIBUTE #else #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER #endif The checks inside gio/giomodule.c should be changed to the same one as is used in configure.ac: #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
Yeah, I realized that, but does the locally-created MAC_OS_X_9 work? IIRC there was a reason I didn't want to use MAC_OS_X_VERSION_MIN_REQUIRED there, I just don't remember what it was.
Yes, it works but you have to add something like AS_IF([test "x$ac_cv_have_os_x_9_or_later" = xyes], [ AC_DEFINE(MAC_OS_X_9, 1, [define to 1 on OS X 9 or later deployment target]) ]) to configure.ac because there's just a AM_CONDITIONAL() for it which doesn't create the macro. As expected, the macro doesn't get defined in config.h with target < 10.9 even when built with 12.12 and the introspection package is built correctly too.
I decided to go with simply using MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 because I couldn't think of a good reason for it to be set at configure time.