On Sun, 23 Jul 2006, Raymond Meyer wrote:
Hi, I think there is an issue with lib/libX11.so libraries on sparc solaris.
Some applications that link to libX11 fail with the following error:
Undefined first referenced
symbol in file
getservbyname_r /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
getsockname /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
gethostbyname_r /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
socket /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
authdes_create /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
setsockopt /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
connect /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
xdrmem_create /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
getpeername /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
freeaddrinfo /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
inet_addr /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
inet_pton /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
gai_strerror /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
shutdown /opt/pkg.obj/graphics/libwmf/work.ultra10/.buildlink/lib/libX11.so
ld: fatal: Symbol referencing errors. No output written to .libs/wmf2eps
*** Error code 1
I think the problem here is attributed to the fact that libX11.so should have been
linked with: -lsocket -lnsl, those libraries contain the missing symbols.
As you can see below, solaris' /usr/openwin/lib/libX11.so is linked to libsocket and
libnsl
[root@ultra10] ldd /opt/pkg/xfree86/lib/libX11.so
mpss.so.1 => /usr/lib/mpss.so.1
libdl.so.1 => /lib/libdl.so.1
libc.so.1 => /lib/libc.so.1
libgen.so.1 => /lib/libgen.so.1
libm.so.2 => /lib/libm.so.2
/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
[root@ultra10] ldd /usr/openwin/lib/libX11.so
mpss.so.1 => /usr/lib/mpss.so.1
libsocket.so.1 => /lib/libsocket.so.1
libnsl.so.1 => /lib/libnsl.so.1
libXext.so.0 => /usr/openwin/lib/libXext.so.0
libdl.so.1 => /lib/libdl.so.1
libc.so.1 => /lib/libc.so.1
libgen.so.1 => /lib/libgen.so.1
libmp.so.2 => /lib/libmp.so.2
libmd5.so.1 => /lib/libmd5.so.1
libscf.so.1 => /lib/libscf.so.1
libdoor.so.1 => /lib/libdoor.so.1
libuutil.so.1 => /lib/libuutil.so.1
libm.so.2 => /lib/libm.so.2
/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
/platform/SUNW,Ultra-5_10/lib/libmd5_psr.so.1
Well, the following will most likely fix this:
- cd <build_dir>/xc/lib/X11
- In Imakefile and Makefile, add $(EXTRA_LIBRARIES) to the REQUIREDLIBS
setting
- find . -name libX11\* -print | xargs rm
- make install
- rebuild the application.
However, I'm not sure this is the right thing to do. For one, this problem
doesn't show up with apps built through imake. In fact, adding
EXTRA_LIBRARIES as above causes imake-generated apps to be linked twice
against libsocket and libnsl. Now that's not an issue on Solaris, but it
could be on some other system with a non-null EXTRA_LIBRARIES, because the
above changes the order in which libraries are found.
Thus, I'm inclined to call this problem a bug, or an oversight, in apps built
with GNU's automangle suite, that have not been properly ported to systems
whose socket library is not part of libc.
Marc.
+----------------------------------+-----------------------------------+
| Marc Aurele La France | work: 1-780-492-9310 |
| Academic Information and | fax: 1-780-492-1729 |
| Communications Technologies | email: tsi@xxxxxxxxxxx |
| 352 General Services Building +-----------------------------------+
| University of Alberta | |
| Edmonton, Alberta | Standard disclaimers apply |
| T6G 2H1 | |
| CANADA | |
+----------------------------------+-----------------------------------+
XFree86 developer and VP. ATI driver and X server internals.
_______________________________________________
XFree86 mailing list
XFree86@xxxxxxxxxxx
http://XFree86.Org/mailman/listinfo/xfree86