GNOME Bugzilla – Bug 675550
linking fails due to missing -lnsl on OpenIndiana
Last modified: 2012-12-28 13:26:52 UTC
Created attachment 213537 [details] [review] check for -lnsl CCLD glib-compile-resources /gentoo/prefix64/usr/lib/gcc/x86_64-pc-solaris2.11/4.6.3/../../../../x86_64-pc-solaris2.11/bin/ld: ./.libs/libgio-2.0.a(libgio_2_0_la-ginetaddress.o): undefined reference to symbol 'inet_ntop@@SUNW_1.7' /gentoo/prefix64/usr/lib/gcc/x86_64-pc-solaris2.11/4.6.3/../../../../x86_64-pc-solaris2.11/bin/ld: note: 'inet_ntop@@SUNW_1.7' is defined in DSO /lib/amd64/libnsl.so.1 so try adding it to the linker command line /lib/amd64/libnsl.so.1: could not read symbols: Invalid operation collect2: ld returned 1 exit status While libsocket.so depends on libnsl.so itself, it seems that on OpenIndiana, this is no longer sufficient for the linker. (underlinking?) With the same linker on Solaris 10, the link succeeds, however on OpenIndiana it needs explicit -lnsl (as per man-page on Solaris since ages). I've added a AC_SEARCH_LIBS to add -lnsl if it is available, not to break hosts where this library is not available.
patch appears no longer necessary with 2.34.1