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 673250 - Activating gnextstepsettingsbackend.c requires -framework Foundation
Activating gnextstepsettingsbackend.c requires -framework Foundation
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: build
2.32.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-03-31 18:37 UTC by Daniel Macks
Modified: 2012-06-05 17:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Link against Foundation framework when libgio uses gnextstepsettingsbackend (462 bytes, patch)
2012-03-31 18:37 UTC, Daniel Macks
none Details | Review

Description Daniel Macks 2012-03-31 18:37:45 UTC
Created attachment 211037 [details] [review]
Link against Foundation framework when libgio uses gnextstepsettingsbackend

I'm building glib-2.32.0 on OS X 10.6 (forcing arch i386), using XCode-4.2. In order to make libraries more able to be dlopen()ed and generally less likely to cause problems for others that would link against them due to missing -l flags, I activate -no-undefined in the makefiles. This leads to:

  CCLD   libgio-2.0.la
Undefined symbols for architecture i386:
  ".objc_class_name_NSString", referenced from:
      pointer-to-literal-objc-class-name in libgio_2_0_la-gnextstepsettingsbackend.o
  ".objc_class_name_NSAutoreleasePool", referenced from:
      pointer-to-literal-objc-class-name in libgio_2_0_la-gnextstepsettingsbackend.o
  ".objc_class_name_NSNumber", referenced from:
      pointer-to-literal-objc-class-name in libgio_2_0_la-gnextstepsettingsbackend.o
  "_objc_msgSend", referenced from:
      _g_nextstep_settings_backend_finalize in libgio_2_0_la-gnextstepsettingsbackend.o
      _g_nextstep_settings_backend_read in libgio_2_0_la-gnextstepsettingsbackend.o
      _g_nextstep_settings_backend_write in libgio_2_0_la-gnextstepsettingsbackend.o
      _g_nextstep_settings_backend_write_tree in libgio_2_0_la-gnextstepsettingsbackend.o
      _g_nextstep_settings_backend_reset in libgio_2_0_la-gnextstepsettingsbackend.o
      _g_nextstep_settings_backend_sync in libgio_2_0_la-gnextstepsettingsbackend.o
      _g_nextstep_settings_backend_init in libgio_2_0_la-gnextstepsettingsbackend.o
      ...
  "_objc_msgSend_fpret", referenced from:
      _g_nextstep_settings_backend_get_g_variant in libgio_2_0_la-gnextstepsettingsbackend.o
  "_objc_enumerationMutation", referenced from:
      _g_nextstep_settings_backend_get_g_variant in libgio_2_0_la-gnextstepsettingsbackend.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
make[4]: *** [libgio-2.0.la] Error 1

./configure is reporting:

checking for Mac OS X Carbon support... yes

which means that gnextstepsettingsbackend.c is built into libgio-2.0.la. That source uses the Foundation framework, but that framework is not linked when building the library. As a result, the symbols that the object uses are not resolvable. Linking against the framework solves the problem for me.

I'm not sure the best place to insert this...attached patch does it in configure.ac as part of the other -framework flag set based on Carbon detection. Could instead go in the Makefile as a conditional item added specifically to libgio_2_0_la_LIBADD or ..._LDFLAGS I guess.
Comment 1 Daniel Macks 2012-06-05 17:20:46 UTC
Appears to be resolved in glib-2.32.3, presumably by commit a147004b83ee48265e266e33da7656a3a09c7edb