pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/MesaLib Add some SUBST magic for NetBSD to ch...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/76c192064371
branches:  trunk
changeset: 541788:76c192064371
user:      bjs <bjs%pkgsrc.org@localhost>
date:      Fri Apr 25 20:11:11 2008 +0000

description:
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:

 graphics/MesaLib/Makefile |   3 ++-
 graphics/MesaLib/hacks.mk |  18 +++++++++++++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r 056cbc18988e -r 76c192064371 graphics/MesaLib/Makefile
--- a/graphics/MesaLib/Makefile Fri Apr 25 20:06:15 2008 +0000
+++ b/graphics/MesaLib/Makefile Fri Apr 25 20:11:11 2008 +0000
@@ -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 -r 056cbc18988e -r 76c192064371 graphics/MesaLib/hacks.mk
--- a/graphics/MesaLib/hacks.mk Fri Apr 25 20:06:15 2008 +0000
+++ b/graphics/MesaLib/hacks.mk Fri Apr 25 20:11:11 2008 +0000
@@ -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 @@
 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



Home | Main Index | Thread Index | Old Index