Subject: Re: AIGLX, MesaLib, and libpthread issues: *solved*
To: Blair Sadewitz <blair.sadewitz@gmail.com>
From: Eric Anholt <eric@anholt.net>
List: tech-x11
Date: 04/13/2007 11:34:04
--=-oYmsynhmMqMlUWnjjRz1
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Fri, 2007-04-13 at 01:27 -0400, Blair Sadewitz wrote:
> OK, here's the deal:
>=20
> 1) libX11 in pkgsrc was being built with its own thread stubs.  This
> is wrong, as NetBSD provides thread stubs; it wasn't detecting them
> because it wasn't including <pthread.h> during the autodetection.  A
> patch for this is attached.
>=20
>=20
> 2) _Don't_ link the Xorg server nor _any library in Mesa_ with
> -lpthread.  It is merely thread-aware, and only needs stubs.  If it's
> used by a threaded program, it will work automagically.
> In addition to removing -lpthread from all "LIB_DEPS" in the config
> files, you have to remove it from src/mesa/drivers/dri/glcore/Makefile
> as well (it's in the rule for libmesa.a).

I'm glad to hear this.  For XCB, the solution they chose was to make a
little module called "thread-stubs" which installs either a library
containing thread stubs, or nothing, and provides a .pc file for
thread-stubs which will link the library or nothing as appropriate for
your OS.  It might make sense to fix that package for NetBSD if
necessary and switch Mesa and non-XCBed libX11 to using it.

> That's it, I think, but I might be forgetting something.  Oh, yeah, in
> order to build many packages properly with Mesa 6.5.2, you need to
> change -DGLX_GLXEXT_LEGACY in the buildlink3.mk file to
> -DGLX_GLXEXT_PROTOTYPES.  If this is not done, programs won't get what
> they want from the headers  (qt3 and glitz are examples).
>=20
> Also, the mesa-dri package should not build libGLU, and it should not
> install most of those header files.  I will fix up this package if it
> is OK with the maintainer.
>=20
> Let me know how this works out for you guys.
>=20
> --Blair
--=20
Eric Anholt                             anholt@FreeBSD.org
eric@anholt.net                         eric.anholt@intel.com


--=-oYmsynhmMqMlUWnjjRz1
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQBGH80YHUdvYGzw6vcRAn3pAJ9OjzvJQzw7Pn+uYC214s1PLV2LDgCcCV4l
JKSyIUU409BYA9tMjun6ZiI=
=GQQg
-----END PGP SIGNATURE-----

--=-oYmsynhmMqMlUWnjjRz1--