Fri Apr 25 20:11:11 2008 UTC ()
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.


(bjs)
diff -r1.57 -r1.58 pkgsrc/graphics/MesaLib/Makefile
diff -r1.5 -r1.6 pkgsrc/graphics/MesaLib/hacks.mk

cvs diff -r1.57 -r1.58 pkgsrc/graphics/MesaLib/Makefile (expand / switch to unified diff)

--- pkgsrc/graphics/MesaLib/Makefile 2008/04/24 07:40:24 1.57
+++ pkgsrc/graphics/MesaLib/Makefile 2008/04/25 20:11:11 1.58
@@ -1,16 +1,17 @@ @@ -1,16 +1,17 @@
1# $NetBSD: Makefile,v 1.57 2008/04/24 07:40:24 bjs Exp $ 1# $NetBSD: Makefile,v 1.58 2008/04/25 20:11:11 bjs Exp $
2 2
3PKGNAME= MesaLib-${MESA_PKGVERSION} 3PKGNAME= MesaLib-${MESA_PKGVERSION}
 4PKGREVISION= 1
4COMMENT= Graphics library similar to SGI's OpenGL 5COMMENT= Graphics library similar to SGI's OpenGL
5 6
6MESA_HEADERS= gl.h gl_mangle.h glext.h glx.h glxext.h \ 7MESA_HEADERS= gl.h gl_mangle.h glext.h glx.h glxext.h \
7 glx_mangle.h osmesa.h xmesa.h xmesa_x.h \ 8 glx_mangle.h osmesa.h xmesa.h xmesa_x.h \
8 xmesa_xf86.h 9 xmesa_xf86.h
9 10
10PKG_DESTDIR_SUPPORT= user-destdir 11PKG_DESTDIR_SUPPORT= user-destdir
11 12
12BUILD_DEFS+= MESA_HZ MESA_EXECMEM_HEAPSIZE 13BUILD_DEFS+= MESA_HZ MESA_EXECMEM_HEAPSIZE
13 14
14.include "../../mk/bsd.prefs.mk" 15.include "../../mk/bsd.prefs.mk"
15 16
16CFLAGS.NetBSD+= -D_NETBSD_SOURCE 17CFLAGS.NetBSD+= -D_NETBSD_SOURCE

cvs diff -r1.5 -r1.6 pkgsrc/graphics/MesaLib/Attic/hacks.mk (expand / switch to unified diff)

--- pkgsrc/graphics/MesaLib/Attic/hacks.mk 2008/04/24 07:40:24 1.5
+++ pkgsrc/graphics/MesaLib/Attic/hacks.mk 2008/04/25 20:11:11 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: hacks.mk,v 1.5 2008/04/24 07:40:24 bjs Exp $ 1# $NetBSD: hacks.mk,v 1.6 2008/04/25 20:11:11 bjs Exp $
2 2
3.if !defined(MESALIBS_HACKS_MK) 3.if !defined(MESALIBS_HACKS_MK)
4MESALIBS_HACKS_MK= # defined 4MESALIBS_HACKS_MK= # defined
5 5
6### [Fri Dec 30 21:00:59 CET 2005 : schwarz] 6### [Fri Dec 30 21:00:59 CET 2005 : schwarz]
7### make sys/types.h not conflict with inttypes.h 7### make sys/types.h not conflict with inttypes.h
8### (issue is specific to IRIX 5.3) 8### (issue is specific to IRIX 5.3)
9### 9###
10. if !empty(MACHINE_PLATFORM:MIRIX-5.3-*) 10. if !empty(MACHINE_PLATFORM:MIRIX-5.3-*)
11PKG_HACKS+= sys_types_h-inttypes_h-conflict 11PKG_HACKS+= sys_types_h-inttypes_h-conflict
12post-wrapper: 12post-wrapper:
13 ${MKDIR} ${BUILDLINK_DIR}/include/sys && ${GREP} -v '^typedef.*[^u_]int[12368]*_t;' /usr/include/sys/types.h > ${BUILDLINK_DIR}/include/sys/types.h 13 ${MKDIR} ${BUILDLINK_DIR}/include/sys && ${GREP} -v '^typedef.*[^u_]int[12368]*_t;' /usr/include/sys/types.h > ${BUILDLINK_DIR}/include/sys/types.h
14# should match int8_t, int16_t, and int32_t (only) 14# should match int8_t, int16_t, and int32_t (only)
@@ -24,15 +24,31 @@ post-wrapper: @@ -24,15 +24,31 @@ post-wrapper:
24PKG_HACKS+= no-strict-aliasing 24PKG_HACKS+= no-strict-aliasing
25CFLAGS+= -fno-strict-aliasing 25CFLAGS+= -fno-strict-aliasing
26PKG_HACKS+= gcc-fast-math 26PKG_HACKS+= gcc-fast-math
27CFLAGS+= -ffast-math 27CFLAGS+= -ffast-math
28. endif 28. endif
29 29
30. if !empty(CC_VERSION:Mgcc-[4-9]*) 30. if !empty(CC_VERSION:Mgcc-[4-9]*)
31# Don't hide symbols for glut by default, it doesn't know how to unhide them. 31# Don't hide symbols for glut by default, it doesn't know how to unhide them.
32. if empty(PKGNAME:M*glut*) 32. if empty(PKGNAME:M*glut*)
33PKG_HACKS+= gcc-hidden-visibility 33PKG_HACKS+= gcc-hidden-visibility
34CFLAGS+= -fvisibility=hidden 34CFLAGS+= -fvisibility=hidden
35. endif 35. endif
36. endif 36. endif
 37###
 38### XXX this shoddy hack is here to fix the unresolved symbol error that
 39### results due to '.extern pthread_getspecific' in the x86 and x86-64
 40### assembler dispatch routines. This should be removed ASAP!
 41###
 42. include "../../mk/bsd.fast.prefs.mk"
 43
 44. if ${OPSYS} == "NetBSD" && !empty(MACHINE_ARCH:M*86*) && \
 45 empty(PTHREAD_STUBLIB:U:M*pthstub*)
 46SUBST_CLASSES+= asm-hack
 47SUBST_FILES.asm-hack= src/mesa/x86/glapi_x86.S
 48SUBST_FILES.asm-jack+= src/mesa/x86/glapi_x86-64.S
 49SUBST_MESSAGE.asm-hack+=Teaching x86 assembler code about NetBSD thread stubs
 50SUBST_SED.asm-hack= -e 's,pthread_getspecific,__libc_thr_getspecific,g'
 51SUBST_STAGE.asm-hack= post-patch
 52. endif
37 53
38.endif 54.endif