Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#15221 closed defect (fixed)

glib2 fails to build on x86_64 with 'Symbol not found' error

Reported by: dwalthour@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: glib2

Description (last modified by jmpp@…)

steps to reproduce:

  1. modify variants.conf to add +universal
  1. modify potconfigure.tcl to add -arch x86_64 to configure.universal_cflags, configure.universal_cxxflags, and configure.universal_ldflags
  1. port install glib2 fails with:
$ sudo port install glib2
--->  Building glib2 with target all
Error: Target org.macports.build returned: shell command " cd "/opt/local-64/var/macports/build/_opt_local-64_var_macports_sources_rsync.macports.org_release_ports_devel_glib2/work/glib-2.16.3" && make all " returned error 2
Command output: make[4]: Nothing to be done for `all-am'.
Making all in tests
make[4]: Nothing to be done for `all'.
Making all in gmodule
make  all-am
make[3]: Nothing to be done for `all-am'.
Making all in gthread
make[2]: Nothing to be done for `all'.
Making all in gobject
make glib-genmarshal
make[3]: `glib-genmarshal' is up to date.
echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
	&& echo "#define __G_MARSHAL_H__" >> xgen-gmh \
	&& ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal ./gmarshal.list --header >> xgen-gmh \
	&& echo "#endif /* __G_MARSHAL_H__ */" >> xgen-gmh \
	&& (cmp -s xgen-gmh gmarshal.h 2>/dev/null || cp xgen-gmh gmarshal.h) \
	&& rm -f xgen-gmh xgen-gmh~ \
	&& echo timestamp > stamp-gmarshal.h
dyld: lazy symbol binding failed: Symbol not found: __g_getenv_nomalloc
  Referenced from: /opt/local-64/var/macports/build/_opt_local-64_var_macports_sources_rsync.macports.org_release_ports_devel_glib2/work/glib-2.16.3/glib/.libs/libglib-2.0.0.dylib
  Expected in: flat namespace

dyld: Symbol not found: __g_getenv_nomalloc
  Referenced from: /opt/local-64/var/macports/build/_opt_local-64_var_macports_sources_rsync.macports.org_release_ports_devel_glib2/work/glib-2.16.3/glib/.libs/libglib-2.0.0.dylib
  Expected in: flat namespace

/bin/sh: line 1: 73719 Trace/BPT trap          ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal ./gmarshal.list --header >> xgen-gmh
make[2]: *** [stamp-gmarshal.h] Error 133
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: Status 1 encountered during processing.

Attachments (4)

patch-gmem.c.diff (435 bytes) - added by dwalthour@… 16 years ago.
patch-gslice.c.diff (423 bytes) - added by dwalthour@… 16 years ago.
patch-gutils.h.diff (433 bytes) - added by dwalthour@… 16 years ago.
patch2-gutils.c.diff (679 bytes) - added by dwalthour@… 16 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 16 years ago by jmroot (Joshua Root)

Milestone: Port Bugs
Owner: changed from macports-tickets@… to ryandesign@…

Assigning to maintainer. I've seen glib2 fail building for x86_64 with MP trunk as well.

comment:2 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

If you can figure out what needs to be changed to make it work, please let me know. But I'm not really supporting 64-bit builds of anything in MacPorts right now.

comment:3 in reply to:  2 Changed 16 years ago by dwalthour@…

Replying to ryandesign@macports.org:

If you can figure out what needs to be changed to make it work, please let me know. But I'm not really supporting 64-bit builds of anything in MacPorts right now.

I understand. I have already downloaded glib2 directly from the GTK+ website and reproduced the problem, so it isn't anything to do with macports. I will see what I can come up with but if you have anything to offer I would appreciate the help.

comment:4 Changed 16 years ago by jmpp@…

Description: modified (diff)

comment:5 Changed 16 years ago by dwalthour@…

Ok, so the problem is that the function _g_getenv_nomalloc is being excluded from the shared library due to the presence of the underscore as the first character of the function name. This function, while it is intended to be private, needs to be exportable from the shared library for it to load correctly. Also, this is somehow not a problem when building a 32-bit only version of the library. When I rename the function to remove that underscore, I have no problems building the library.

Now here is my problem. I have heretofore been only a user of macports and not a contributer. I would be more than happy to provide a patch file for this, but I have no knowledge of how to go about doing it. I will read the docs and try to get a good idea on how to do this, but any help or tips would be appreciated.

comment:6 Changed 16 years ago by dwalthour@…

Ok, so the docs were sufficient. I will attach the patch files to this ticket.

Changed 16 years ago by dwalthour@…

Attachment: patch-gmem.c.diff added

Changed 16 years ago by dwalthour@…

Attachment: patch-gslice.c.diff added

Changed 16 years ago by dwalthour@…

Attachment: patch-gutils.h.diff added

Changed 16 years ago by dwalthour@…

Attachment: patch2-gutils.c.diff added

comment:7 Changed 15 years ago by jmroot (Joshua Root)

Keywords: glib2 removed
Port: glib2 added

Was this ever reported upstream? Building glib2 for x86_64 doesn't seem to fail outright with the latest version, though there's still #17042.

comment:8 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: mcalhoun@… added

Cc Me!

comment:9 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: newclosed

With r49134, the x86_64 build of glib2 should work within the universal framework (no need to modify potconfigure.tcl).

comment:10 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.