From 15fa89cdf33414fa3c5fa898b7314c5af0897265 Mon Sep 17 00:00:00 2001 From: bjs Date: Fri, 25 Apr 2008 20:11:11 +0000 Subject: Add some SUBST magic for NetBSD to change the name of the function called in the x86/x86_64 assembler dispatch routine to __thr_getspecific to avoid an unresolved symbol error from ld at link-time. This is a weak alias in libc and a strong alias in libpthread, so everything should work fine. This could probably be fixed in a better way, but for now, I think "it works" is a plus. Bump rev. --- graphics/MesaLib/Makefile | 3 ++- graphics/MesaLib/hacks.mk | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'graphics') diff --git a/graphics/MesaLib/Makefile b/graphics/MesaLib/Makefile index 4231751cffd..b54c4a73a36 100644 --- a/graphics/MesaLib/Makefile +++ b/graphics/MesaLib/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.57 2008/04/24 07:40:24 bjs Exp $ +# $NetBSD: Makefile,v 1.58 2008/04/25 20:11:11 bjs Exp $ PKGNAME= MesaLib-${MESA_PKGVERSION} +PKGREVISION= 1 COMMENT= Graphics library similar to SGI's OpenGL MESA_HEADERS= gl.h gl_mangle.h glext.h glx.h glxext.h \ diff --git a/graphics/MesaLib/hacks.mk b/graphics/MesaLib/hacks.mk index 5800cbeae3a..9890ce9a0d4 100644 --- a/graphics/MesaLib/hacks.mk +++ b/graphics/MesaLib/hacks.mk @@ -1,4 +1,4 @@ -# $NetBSD: hacks.mk,v 1.5 2008/04/24 07:40:24 bjs Exp $ +# $NetBSD: hacks.mk,v 1.6 2008/04/25 20:11:11 bjs Exp $ .if !defined(MESALIBS_HACKS_MK) MESALIBS_HACKS_MK= # defined @@ -34,5 +34,21 @@ PKG_HACKS+= gcc-hidden-visibility CFLAGS+= -fvisibility=hidden . endif . endif +### +### XXX this shoddy hack is here to fix the unresolved symbol error that +### results due to '.extern pthread_getspecific' in the x86 and x86-64 +### assembler dispatch routines. This should be removed ASAP! +### +. include "../../mk/bsd.fast.prefs.mk" + +. if ${OPSYS} == "NetBSD" && !empty(MACHINE_ARCH:M*86*) && \ + empty(PTHREAD_STUBLIB:U:M*pthstub*) +SUBST_CLASSES+= asm-hack +SUBST_FILES.asm-hack= src/mesa/x86/glapi_x86.S +SUBST_FILES.asm-jack+= src/mesa/x86/glapi_x86-64.S +SUBST_MESSAGE.asm-hack+=Teaching x86 assembler code about NetBSD thread stubs +SUBST_SED.asm-hack= -e 's,pthread_getspecific,__libc_thr_getspecific,g' +SUBST_STAGE.asm-hack= post-patch +. endif .endif -- cgit v1.2.3