Opened 14 years ago

Closed 14 years ago

#26711 closed defect (fixed)

glib2 @2.26.0 links against dbus without declaring dependency

Reported by: raimue (Rainer Müller) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc: dbevans (David B. Evans)
Port: glib2

Description

While upgrading to glib2 @2.26.0+universal, I see the following error:

ld: warning: in /opt/local/lib/libdbus-1.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
  "_dbus_error_free", referenced from:
      _check_serialization in gdbus_serialization-gdbus-serialization.o
[...]

My installed dbus port is not +universal, but it is also not in the recursive dependency list of glib2:

$ port installed glib2 dbus
The following ports are currently installed:
  dbus @1.2.24_1 (active)
  glib2 @2.24.2_0+universal (active)
$ port rdeps glib2 |grep -i dbus
$

Either there is a missing dependency on dbus as of 2.26.0, or maybe glib2 only enables this conditionally if specific headers are found?

Attachments (3)

main.log (616.2 KB) - added by raimue (Rainer Müller) 14 years ago.
config.log (407.6 KB) - added by raimue (Rainer Müller) 14 years ago.
patch-glib2-dbus.diff (715 bytes) - added by dbevans (David B. Evans) 14 years ago.
Proposed patch for Portfile

Download all attachments as: .zip

Change History (8)

Changed 14 years ago by raimue (Rainer Müller)

Attachment: main.log added

Changed 14 years ago by raimue (Rainer Müller)

Attachment: config.log added

comment:1 Changed 14 years ago by dbevans (David B. Evans)

Cc: devans@… added

I ran into this last night as well. In configure glib2 enables building of GBus tests if dbus is detected or disables them if not. So configure succeeds either way. But there is no off switch for this. So if dbus is installed but not universal and you attempt to build glib2 universal there is an arch mismatch for libdbus-1.dylib.

Adding a dependency on dbus forces dbus to be built universal and fixes the problem (for me at least).

Patch attached.

Changed 14 years ago by dbevans (David B. Evans)

Attachment: patch-glib2-dbus.diff added

Proposed patch for Portfile

comment:2 Changed 14 years ago by ruud@…

The patch fixes it for me.

comment:3 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Isn't it just a build dependency? I don't see anything in glib2 linking with the dbus dynamic library.

comment:4 Changed 14 years ago by dbevans (David B. Evans)

Perhaps, it's used here:

libtool: link: /usr/bin/gcc-4.2 -I/opt/quartz/include/dbus-1.0 -I/opt/quartz/lib/dbus-1.0/include -pipe -O2 -fstrict-aliasing -arch x86_64 -Wall -bind_at_load -arch x86_64 -o .libs/gdbus-serialization gdbus_serialization-gdbus-serialization.o gdbus_serialization-gdbus-tests.o  -L/opt/quartz/lib ../../glib/.libs/libglib-2.0.dylib ../../gthread/.libs/libgthread-2.0.dylib ../../gobject/.libs/libgobject-2.0.dylib ../../gio/.libs/libgio-2.0.dylib /opt/quartz/var/macports/build/_Volumes_wdc-320_opt_macports_trunk_dports_devel_glib2/work/glib-2.26.0/gobject/.libs/libgobject-2.0.dylib /opt/quartz/var/macports/build/_Volumes_wdc-320_opt_macports_trunk_dports_devel_glib2/work/glib-2.26.0/gthread/.libs/libgthread-2.0.dylib /opt/quartz/var/macports/build/_Volumes_wdc-320_opt_macports_trunk_dports_devel_glib2/work/glib-2.26.0/gmodule/.libs/libgmodule-2.0.dylib /opt/quartz/var/macports/build/_Volumes_wdc-320_opt_macports_trunk_dports_devel_glib2/work/glib-2.26.0/glib/.libs/libglib-2.0.dylib -lresolv -lz /opt/quartz/lib/libdbus-1.dylib -lpthread /opt/quartz/lib/libintl.dylib /opt/quartz/lib/libiconv.dylib -lc -framework Carbon

But only for testing suite, looks like nothing that is actually installed references libdbus-1.dylib

comment:5 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Running "otool -L" on everything installed by glib2, I don't see anything linking with libdbus-1.dylib. If it's used in the test suite, presumably the test suite is not something that gets installed. So I'll make it a build dependency for now. r72107.

Note: See TracTickets for help on using tickets.