XFree86 3.3.6 for FreeBSD/ELF defaults to using XThreads and builds a stub library libXThrStub.so.6 which is referenced from libX11 and libXt, though it is not explicitly specified as a library dependency. When programs are linked against libX11 and/or libXt, the linker needs to locate libXThrStub.so.6. The GNU ELF linker uses -rpath-link, rather than -L to specify this search path, however this is not specified in the FreeBSD configuration file, resulting in linker failures. Fix: Ensure that the link step includes a `-rpath-link $(BUILDLIBDIR)' when XFree86 is being built (!UseInstalled). The simplest way to achieve this is to remove the FreeBSD special case and use the default from bsdLib.rules, as shown below. I don't know if a similar fix is needed for the aout variant. How-To-Repeat: Build the XFree86 port without XFree86 installed (or with an old version prior to XThread support). This will result in all the X clients failing to build as follows: making all in programs/bitmap... ... cc -o bitmap -ansi -pedantic -Dasm=__asm -L../../exports/lib BitEdit.o CutPaste.o Graphics.o ReqMach.o Bitmap.o Dialog.o Handlers.o -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11 -L/usr/X11R6/lib -lxpg4 -lm -Wl,-rpath,/usr/X11R6/lib ../../exports/lib/libXaw.so: warning: tmpnam() possibly used unsafely; consider using mkstemp() /usr/libexec/elf/ld: warning: libXThrStub.so.6, needed by ../../exports/lib/libXt.so, not found (try using --rpath) ../../exports/lib/libXt.so: undefined reference to `pthread_cond_signal' ../../exports/lib/libX11.so: undefined reference to `pthread_cond_broadcast' ../../exports/lib/libXt.so: undefined reference to `pthread_cond_init' ../../exports/lib/libXt.so: undefined reference to `pthread_mutex_unlock' ../../exports/lib/libXt.so: undefined reference to `pthread_self' ../../exports/lib/libXt.so: undefined reference to `pthread_mutex_destroy' ../../exports/lib/libXt.so: undefined reference to `pthread_mutex_lock' ../../exports/lib/libXt.so: undefined reference to `pthread_cond_wait' ../../exports/lib/libXt.so: undefined reference to `pthread_cond_destroy' ../../exports/lib/libXt.so: undefined reference to `pthread_mutex_init' *** Error code 1 (continuing)
Responsible Changed From-To: freebsd-ports->jmz I am the maintainer.
State Changed From-To: open->closed Patch committed. Thanks!