Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#20301 closed defect (fixed)

glib2-devel 2.21.3: build fails with link error (needs -lresolv)

Reported by: dbevans (David B. Evans) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: libresolv Cc:
Port: glib2-devel

Description

Mac OS X 10.4.11 ppc Xcode 2.5 (full debug output attached):

/bin/sh ../../libtool --tag=CC   --mode=link /usr/bin/gcc-4.0  -O2 -fstrict-aliasing -Wall  -L/opt/local/lib -bind_at_load -framework Carbon -o simple-async-result simple-async-result.o ../../glib/libglib-2.0.la ../../gobject/libgobject-2.0.la ../../gio/libgio-2.0.la -lintl  
libtool: link: /usr/bin/gcc-4.0 -O2 -fstrict-aliasing -Wall -bind_at_load -o .libs/simple-async-result simple-async-result.o  -L/opt/local/lib ../../glib/.libs/libglib-2.0.dylib ../../gobject/.libs/libgobject-2.0.dylib ../../gio/.libs/libgio-2.0.dylib /Volumes/wdc-320/opt/local/var/macports/build/_Volumes_wdc-320_opt_macports_trunk_dports_devel_glib2-devel/work/glib-2.21.3/gobject/.libs/libgobject-2.0.dylib /Volumes/wdc-320/opt/local/var/macports/build/_Volumes_wdc-320_opt_macports_trunk_dports_devel_glib2-devel/work/glib-2.21.3/gmodule/.libs/libgmodule-2.0.dylib /Volumes/wdc-320/opt/local/var/macports/build/_Volumes_wdc-320_opt_macports_trunk_dports_devel_glib2-devel/work/glib-2.21.3/glib/.libs/libglib-2.0.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -lc -framework Carbon
/usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I../.. -g -I../.. -I../../glib -I../../gmodule -I../../gobject -I../../gio -DG_ENABLE_DEBUG -DSRCDIR=\""."\"  -I/opt/local/include -DG_DISABLE_SINGLE_INCLUDES -D_REENTRANT  -O2 -fstrict-aliasing -Wall -MT srvtarget.o -MD -MP -MF .deps/srvtarget.Tpo -c -o srvtarget.o srvtarget.c
mv -f .deps/srvtarget.Tpo .deps/srvtarget.Po
/bin/sh ../../libtool --tag=CC   --mode=link /usr/bin/gcc-4.0  -O2 -fstrict-aliasing -Wall  -L/opt/local/lib -bind_at_load -framework Carbon -o srvtarget srvtarget.o ../../glib/libglib-2.0.la ../../gobject/libgobject-2.0.la ../../gio/libgio-2.0.la -lintl  
libtool: link: /usr/bin/gcc-4.0 -O2 -fstrict-aliasing -Wall -bind_at_load -o .libs/srvtarget srvtarget.o  -L/opt/local/lib ../../glib/.libs/libglib-2.0.dylib ../../gobject/.libs/libgobject-2.0.dylib ../../gio/.libs/libgio-2.0.dylib /Volumes/wdc-320/opt/local/var/macports/build/_Volumes_wdc-320_opt_macports_trunk_dports_devel_glib2-devel/work/glib-2.21.3/gobject/.libs/libgobject-2.0.dylib /Volumes/wdc-320/opt/local/var/macports/build/_Volumes_wdc-320_opt_macports_trunk_dports_devel_glib2-devel/work/glib-2.21.3/gmodule/.libs/libgmodule-2.0.dylib /Volumes/wdc-320/opt/local/var/macports/build/_Volumes_wdc-320_opt_macports_trunk_dports_devel_glib2-devel/work/glib-2.21.3/glib/.libs/libglib-2.0.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -lc -framework Carbon
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
_res_9_dn_expand
_res_9_query
_res_9_search
collect2: ld returned 1 exit status
make[4]: *** [srvtarget] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

The undefined symbols are in /usr/lib/libresolv.dylib but -lresolv is not included in link command. Looks like configure fails to properly recognize the need of it (it finds res_query in /usr/lib/libc.dylib and assumes the rest are there as well -- test for functions in -lresolv is never performed).

Attachments (3)

build.log (352.0 KB) - added by dbevans (David B. Evans) 15 years ago.
full debug output
patch-glib2.diff (729 bytes) - added by dbevans (David B. Evans) 15 years ago.
Patch for Portfile
patch-configure.in.diff (266 bytes) - added by dbevans (David B. Evans) 15 years ago.
for files directory

Download all attachments as: .zip

Change History (9)

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

Attachment: build.log added

full debug output

comment:1 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Status: newassigned

I see it too on Tiger / PowerPC.

comment:2 Changed 15 years ago by dbevans (David B. Evans)

Attached is a patch for configure.in that adds an additional test for res_9_query in -lresolv in addition to and after the existing tests for res_query. This allows this version to build on tiger ppc. Haven't tested otherwise but should work on leopard if things work as I think.

For the record, is this just a tiger ppc problem or all tiger? I assume that the existing port works OK on leopard?

FYI, this version of glib2 or better is required by latest unstable nautilus 2.27.4.

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

Attachment: patch-glib2.diff added

Patch for Portfile

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

Attachment: patch-configure.in.diff added

for files directory

comment:3 in reply to:  2 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to devans@…:

For the record, is this just a tiger ppc problem or all tiger? I assume that the existing port works OK on leopard?

I have tested all four systems now, and see the problem on Tiger (PowerPC and Intel) and do not see the problem on Leopard (PowerPC or Intel).

comment:4 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

This is the upstream bug report for this problem.

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

Resolution: fixed
Status: assignedclosed

Thanks for the patch. It worked for me on Tiger Intel (did not test PowerPC this time). Committed in r53885.

comment:6 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

They've fixed this upstream so glib2-devel no longer manually adds -lresolv as of r63162.

Note: See TracTickets for help on using tickets.