summaryrefslogtreecommitdiff
path: root/graphics/MesaLib/hacks.mk
diff options
context:
space:
mode:
authorbjs <bjs@pkgsrc.org>2008-04-25 20:11:11 +0000
committerbjs <bjs@pkgsrc.org>2008-04-25 20:11:11 +0000
commit15fa89cdf33414fa3c5fa898b7314c5af0897265 (patch)
tree78842ff03367e1d6eb0e1dfbf693c4f4e0437d8e /graphics/MesaLib/hacks.mk
parent9080934d3bd7cc112b9f481d5522e1a89b6002cc (diff)
downloadpkgsrc-15fa89cdf33414fa3c5fa898b7314c5af0897265.tar.gz
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.
Diffstat (limited to 'graphics/MesaLib/hacks.mk')
-rw-r--r--graphics/MesaLib/hacks.mk18
1 files changed, 17 insertions, 1 deletions
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