Bug 46387

Summary: X11R6 libXThrStub breaks X11 apps
Product: Ports & Packages Reporter: coolvibe <coolvibe>
Component: Individual Port(s)Assignee: Eric Anholt <anholt>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description coolvibe 2002-12-20 03:10:02 UTC
	Applications that try to link with X fail with the following error:

	azazel# gcc -o test test.c -L /usr/X11R6/lib -I /usr/X11R6/include -lX11
	/usr/X11R6/lib/libX11.so: undefined reference to `pthread_cond_signal'
	/usr/X11R6/lib/libXThrStub.so.6: undefined reference to `_Xthr_zero_stub_'
	/usr/X11R6/lib/libX11.so: undefined reference to `pthread_cond_broadcast'
	/usr/X11R6/lib/libXThrStub.so.6: undefined reference to `_Xthr_self_stub_'
	/usr/X11R6/lib/libX11.so: undefined reference to `pthread_cond_init'
	/usr/X11R6/lib/libX11.so: undefined reference to `pthread_mutex_unlock'
	/usr/X11R6/lib/libX11.so: undefined reference to `pthread_self'
	/usr/X11R6/lib/libX11.so: undefined reference to `pthread_mutex_destroy'
	/usr/X11R6/lib/libX11.so: undefined reference to `pthread_mutex_lock'
	/usr/X11R6/lib/libX11.so: undefined reference to `pthread_cond_wait'
	/usr/X11R6/lib/libX11.so: undefined reference to `pthread_cond_destroy'
	/usr/X11R6/lib/libX11.so: undefined reference to `pthread_mutex_init'

	With -pthread:

	azazel# gcc -o test test.c -L /usr/X11R6/lib -I /usr/X11R6/include -lX11 -pthread
        /usr/X11R6/lib/libXThrStub.so.6: undefined reference to `_Xthr_zero_stub_'
        /usr/X11R6/lib/libXThrStub.so.6: undefined reference to `_Xthr_self_stub_'

How-To-Repeat: 	
	Test code I used:

	-- CUT --	
	char XOpenDisplay();

	int main() {
		XOpenDisplay();
	 	return 0; 
	}
	-- END CUT --
	
	(which is the same test gnu autoconf uses to test for X)
Comment 1 coolvibe 2002-12-20 13:04:48 UTC
Oh, nearly forgot:

XFree86-4-libraries version: XFree86-libraries-4.2.1_5

Cheers,
Emiel
-- 
Emiel Kollof <coolvibe@hackerheaven.org> 
Platform agnostic git, *NIX crash test dummy,
Network necromancer and code mumbling sysadmin.
Comment 2 Mario Sergio Fujikawa Ferreira freebsd_committer freebsd_triage 2002-12-20 14:54:22 UTC
Responsible Changed
From-To: freebsd-ports->anholt

Over to maintainer(s)
Comment 3 Eric Anholt 2003-01-09 22:02:14 UTC
The conclusion of this was that his world was built with CFLAGS
containing -O3, which caused XFree86-4-libraries to be built differently
(incorrectly) compared to when world was built with normal CFLAGS.  The
CFLAGS used when building XFree86-4-libraries didn't matter.

I'm going to close this as a configuration error.

-- 
Eric Anholt                                eta@lclark.edu          
http://people.freebsd.org/~anholt/dri/     anholt@FreeBSD.org
Comment 4 Eric Anholt freebsd_committer freebsd_triage 2003-01-09 22:13:00 UTC
State Changed
From-To: open->closed

Configuration error -- world was built with -O3.