Subject: Re: ThreadedX patch, take 2
To: None <tech-x11@netbsd.org>
From: FUKAUMI Naoki <naoki@fukaumi.org>
List: tech-userlevel
Date: 01/20/2003 17:16:51
Hi

My machine is NetBSD-1.6M/i386 now. I built xsrc with your patch.

% uname -a
NetBSD nforce.naobsd.org 1.6M NetBSD 1.6M (NFORCE) #0: Mon Jan 20 15:15:04 JST 2003     fun@nforce.naobsd.org:/usr/obj/i386/sys/arch/i386/compile/NFORCE i386

I found three X client programs has compile (link) error.

  ico
  glxinfo
  glxgears

This is a part of make log:
  :
gcc -o ico -O2 -ansi -Dasm=__asm     -L../../exports/lib ico.o -lXext -lX11 -L/usr/X11R6/lib  -lm   -Wl,-rpath,/usr/X11R6/lib -Wl,-rpath-link,../../exports/lib
ico.o: In function `do_ico_window':
ico.o(.text+0x18d6): undefined reference to `pthread_mutex_lock'
ico.o(.text+0x18f5): undefined reference to `pthread_cond_broadcast'
ico.o(.text+0x1905): undefined reference to `pthread_mutex_unlock'
ico.o: In function `main':
ico.o(.text+0x2064): undefined reference to `pthread_cond_init'
ico.o(.text+0x209d): undefined reference to `pthread_create'
ico.o(.text+0x20b3): undefined reference to `pthread_mutex_lock'
ico.o(.text+0x20c5): undefined reference to `pthread_cond_wait'
ico.o(.text+0x20d5): undefined reference to `pthread_mutex_unlock'
*** Error code 1 (continuing)
  :
gcc -o glxinfo -O2 -ansi -Dasm=__asm     -L../../exports/lib glxinfo.o -lGLU -lGL -lXext -lX11 -L/usr/X11R6/lib  -lm   -Wl,-rpath,/usr/X11R6/lib -Wl,-rpath-link,../../exports/lib
../../exports/lib/libGL.so: undefined reference to `thr_key_create'
*** Error code 1 (continuing)
  :
gcc -o glxgears -O2 -ansi -Dasm=__asm     -L../../exports/lib glxgears.o -lGL -lXext -lX11 -L/usr/X11R6/lib  -lm   -Wl,-rpath,/usr/X11R6/lib -Wl,-rpath-link,../../exports/lib
../../exports/lib/libGL.so: undefined reference to `thr_key_create'
*** Error code 1 (continuing)
  :

They are not linked to libpthread... How to fix this problem?

> So, assuming bleeding edge xsrc and bleeding edge src, the following
> patch seeems to DTRT with regards to pulling in stubs for non-threaded
> apps, and the real routines for threaded apps.  Patch against xsrc/xfree.

--
FUKAUMI Naoki