pkgsrc-WIP-changes archive

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

libpthread-stubs-dfbsd: Replace wip/libpthread-stubs does nothing



Module Name:	pkgsrc-wip
Committed By:	David Shao <davshao%gmail.com@localhost>
Pushed By:	dshao
Date:		Tue Jan 17 00:18:51 2017 -0800
Changeset:	8c744c2b423c0c1eb1c5983ecf338f7b71d82143

Modified Files:
	Makefile
Added Files:
	libpthread-stubs-dfbsd/DESCR
	libpthread-stubs-dfbsd/Makefile
	libpthread-stubs-dfbsd/PLIST
	libpthread-stubs-dfbsd/TODO
	libpthread-stubs-dfbsd/buildlink3.mk
	libpthread-stubs-dfbsd/distinfo
	libpthread-stubs-dfbsd/libpthread-stubs/DESCR
	libpthread-stubs-dfbsd/libpthread-stubs/Makefile
	libpthread-stubs-dfbsd/libpthread-stubs/PLIST
	libpthread-stubs-dfbsd/libpthread-stubs/buildlink3.mk
	libpthread-stubs-dfbsd/libpthread-stubs/distinfo
	libpthread-stubs-dfbsd/libpthread-stubs/patches/patch-Makefile.in
	libpthread-stubs-dfbsd/libpthread-stubs/patches/patch-stubs.c
	libpthread-stubs-dfbsd/patches/patch-Makefile.in
	libpthread-stubs-dfbsd/patches/patch-stubs.c

Log Message:
libpthread-stubs-dfbsd: Replace wip/libpthread-stubs does nothing

Comment-out any stub code, but always build libpthread-stubs.
Assume sole using port MesaLib looks in devel/libpthread-stubs

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8c744c2b423c0c1eb1c5983ecf338f7b71d82143

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                           |  1 +
 libpthread-stubs-dfbsd/DESCR                       |  9 +++++
 libpthread-stubs-dfbsd/Makefile                    | 19 +++++++++
 libpthread-stubs-dfbsd/PLIST                       |  3 ++
 libpthread-stubs-dfbsd/TODO                        |  5 +++
 libpthread-stubs-dfbsd/buildlink3.mk               | 12 ++++++
 libpthread-stubs-dfbsd/distinfo                    |  8 ++++
 libpthread-stubs-dfbsd/libpthread-stubs/DESCR      |  9 +++++
 libpthread-stubs-dfbsd/libpthread-stubs/Makefile   | 19 +++++++++
 libpthread-stubs-dfbsd/libpthread-stubs/PLIST      |  3 ++
 .../libpthread-stubs/buildlink3.mk                 | 12 ++++++
 libpthread-stubs-dfbsd/libpthread-stubs/distinfo   |  8 ++++
 .../libpthread-stubs/patches/patch-Makefile.in     | 31 +++++++++++++++
 .../libpthread-stubs/patches/patch-stubs.c         | 46 ++++++++++++++++++++++
 libpthread-stubs-dfbsd/patches/patch-Makefile.in   | 27 +++++++++++++
 libpthread-stubs-dfbsd/patches/patch-stubs.c       | 33 ++++++++++++++++
 16 files changed, 245 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 77cba04..cca78e9 100644
--- a/Makefile
+++ b/Makefile
@@ -1646,6 +1646,7 @@ SUBDIR+=	libparsifal
 SUBDIR+=	libpsl
 SUBDIR+=	libpsurface
 SUBDIR+=	libpthread-stubs
+SUBDIR+=	libpthread-stubs-dfbsd
 SUBDIR+=	libpusb
 SUBDIR+=	libpwquality
 SUBDIR+=	libqtxdg
diff --git a/libpthread-stubs-dfbsd/DESCR b/libpthread-stubs-dfbsd/DESCR
new file mode 100644
index 0000000..4e7e85b
--- /dev/null
+++ b/libpthread-stubs-dfbsd/DESCR
@@ -0,0 +1,9 @@
+This library provides weak aliases for pthread functions not provided in libc
+or otherwise available by default.  Libraries like libxcb rely on pthread
+stubs to use pthreads optionally, becoming thread-safe when linked to
+libpthread, while avoiding any performance hit when running single-threaded.
+libpthread-stubs supports this behavior even on platforms which do not supply
+all the necessary pthread stubs.  On platforms which already supply all the
+necessary pthread stubs, this package ships only the pkg-config file
+pthread-stubs.pc, to allow libraries to unconditionally express a dependency
+on pthread-stubs and still obtain correct behavior.
diff --git a/libpthread-stubs-dfbsd/Makefile b/libpthread-stubs-dfbsd/Makefile
new file mode 100644
index 0000000..9775fec
--- /dev/null
+++ b/libpthread-stubs-dfbsd/Makefile
@@ -0,0 +1,19 @@
+# $NetBSD$
+
+DISTNAME=	libpthread-stubs-0.3
+CATEGORIES=	x11
+MASTER_SITES=	https://xcb.freedesktop.org/dist/
+EXTRACT_SUFX=	.tar.bz2
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://xcb.freedesktop.org/
+COMMENT=	This library provides weak aliases for pthread functions
+LICENSE=	mit
+
+GNU_CONFIGURE=	yes
+USE_LIBTOOL=	yes
+USE_TOOLS+=	pkg-config
+
+PKGCONFIG_OVERRIDE+=	pthread-stubs.pc.in
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/libpthread-stubs-dfbsd/PLIST b/libpthread-stubs-dfbsd/PLIST
new file mode 100644
index 0000000..418caea
--- /dev/null
+++ b/libpthread-stubs-dfbsd/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD$
+lib/libpthread-stubs.la
+lib/pkgconfig/pthread-stubs.pc
diff --git a/libpthread-stubs-dfbsd/TODO b/libpthread-stubs-dfbsd/TODO
new file mode 100644
index 0000000..01dd0b0
--- /dev/null
+++ b/libpthread-stubs-dfbsd/TODO
@@ -0,0 +1,5 @@
+Copy port to devel/libpthread-stubs, do not install from wip.
+
+libpthread-stubs last release is from 2009 and actually does
+nothing on any OS tested.  Perhaps update to latest git snapshot
+from freedesktop.org
diff --git a/libpthread-stubs-dfbsd/buildlink3.mk b/libpthread-stubs-dfbsd/buildlink3.mk
new file mode 100644
index 0000000..a2fe280
--- /dev/null
+++ b/libpthread-stubs-dfbsd/buildlink3.mk
@@ -0,0 +1,12 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	libpthread-stubs
+
+.if !defined(LIBPTHREAD_STUBS_BUILDLINK3_MK)
+LIBPTHREAD_STUBS_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libpthread-stubs+=	libpthread-stubs>=0.3
+BUILDLINK_PKGSRCDIR.libpthread-stubs?=	../../wip/libpthread-stubs
+.endif	# LIBPTHREAD_STUBS_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libpthread-stubs
diff --git a/libpthread-stubs-dfbsd/distinfo b/libpthread-stubs-dfbsd/distinfo
new file mode 100644
index 0000000..cbb351b
--- /dev/null
+++ b/libpthread-stubs-dfbsd/distinfo
@@ -0,0 +1,8 @@
+$NetBSD$
+
+SHA1 (libpthread-stubs-0.3.tar.bz2) = 7fc486ad0ec54938f8b781cc374218f50eac8b99
+RMD160 (libpthread-stubs-0.3.tar.bz2) = a3a5f76e103c645749d7b8a8fc00ad472e59987b
+SHA512 (libpthread-stubs-0.3.tar.bz2) = c7cf63fa82ce9e8c37c6dc3b8cc30f8883655f95683c4466c54b617b086dd26a43bfa36363e47dc5730af6d59ac70443d211eb01b07d276edd144030a3580b15
+Size (libpthread-stubs-0.3.tar.bz2) = 203468 bytes
+SHA1 (patch-Makefile.in) = 739f6d82735fc2b7f71e62fd0681c4105ff360ea
+SHA1 (patch-stubs.c) = 90fd7f61bdaf42d124d2aa73151b43c55291e0dd
diff --git a/libpthread-stubs-dfbsd/libpthread-stubs/DESCR b/libpthread-stubs-dfbsd/libpthread-stubs/DESCR
new file mode 100644
index 0000000..4e7e85b
--- /dev/null
+++ b/libpthread-stubs-dfbsd/libpthread-stubs/DESCR
@@ -0,0 +1,9 @@
+This library provides weak aliases for pthread functions not provided in libc
+or otherwise available by default.  Libraries like libxcb rely on pthread
+stubs to use pthreads optionally, becoming thread-safe when linked to
+libpthread, while avoiding any performance hit when running single-threaded.
+libpthread-stubs supports this behavior even on platforms which do not supply
+all the necessary pthread stubs.  On platforms which already supply all the
+necessary pthread stubs, this package ships only the pkg-config file
+pthread-stubs.pc, to allow libraries to unconditionally express a dependency
+on pthread-stubs and still obtain correct behavior.
diff --git a/libpthread-stubs-dfbsd/libpthread-stubs/Makefile b/libpthread-stubs-dfbsd/libpthread-stubs/Makefile
new file mode 100644
index 0000000..9775fec
--- /dev/null
+++ b/libpthread-stubs-dfbsd/libpthread-stubs/Makefile
@@ -0,0 +1,19 @@
+# $NetBSD$
+
+DISTNAME=	libpthread-stubs-0.3
+CATEGORIES=	x11
+MASTER_SITES=	https://xcb.freedesktop.org/dist/
+EXTRACT_SUFX=	.tar.bz2
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://xcb.freedesktop.org/
+COMMENT=	This library provides weak aliases for pthread functions
+LICENSE=	mit
+
+GNU_CONFIGURE=	yes
+USE_LIBTOOL=	yes
+USE_TOOLS+=	pkg-config
+
+PKGCONFIG_OVERRIDE+=	pthread-stubs.pc.in
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/libpthread-stubs-dfbsd/libpthread-stubs/PLIST b/libpthread-stubs-dfbsd/libpthread-stubs/PLIST
new file mode 100644
index 0000000..418caea
--- /dev/null
+++ b/libpthread-stubs-dfbsd/libpthread-stubs/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD$
+lib/libpthread-stubs.la
+lib/pkgconfig/pthread-stubs.pc
diff --git a/libpthread-stubs-dfbsd/libpthread-stubs/buildlink3.mk b/libpthread-stubs-dfbsd/libpthread-stubs/buildlink3.mk
new file mode 100644
index 0000000..9767e10
--- /dev/null
+++ b/libpthread-stubs-dfbsd/libpthread-stubs/buildlink3.mk
@@ -0,0 +1,12 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	libpthread-stubs
+
+.if !defined(LIBPTHREAD_STUBS_BUILDLINK3_MK)
+LIBPTHREAD_STUBS_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libpthread-stubs+=	libpthread-stubs>=0.3
+BUILDLINK_PKGSRCDIR.libpthread-stubs?=	../../devel/libpthread-stubs
+.endif	# LIBPTHREAD_STUBS_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libpthread-stubs
diff --git a/libpthread-stubs-dfbsd/libpthread-stubs/distinfo b/libpthread-stubs-dfbsd/libpthread-stubs/distinfo
new file mode 100644
index 0000000..3fc7e4e
--- /dev/null
+++ b/libpthread-stubs-dfbsd/libpthread-stubs/distinfo
@@ -0,0 +1,8 @@
+$NetBSD$
+
+SHA1 (libpthread-stubs-0.3.tar.bz2) = 7fc486ad0ec54938f8b781cc374218f50eac8b99
+RMD160 (libpthread-stubs-0.3.tar.bz2) = a3a5f76e103c645749d7b8a8fc00ad472e59987b
+SHA512 (libpthread-stubs-0.3.tar.bz2) = c7cf63fa82ce9e8c37c6dc3b8cc30f8883655f95683c4466c54b617b086dd26a43bfa36363e47dc5730af6d59ac70443d211eb01b07d276edd144030a3580b15
+Size (libpthread-stubs-0.3.tar.bz2) = 203468 bytes
+SHA1 (patch-Makefile.in) = 1534afd01e02922f9c193d6f2eb51ca12422dcc7
+SHA1 (patch-stubs.c) = ffb82c0d7700a025c2eb1c4067623b064314924f
diff --git a/libpthread-stubs-dfbsd/libpthread-stubs/patches/patch-Makefile.in b/libpthread-stubs-dfbsd/libpthread-stubs/patches/patch-Makefile.in
new file mode 100644
index 0000000..d95b5c0
--- /dev/null
+++ b/libpthread-stubs-dfbsd/libpthread-stubs/patches/patch-Makefile.in
@@ -0,0 +1,31 @@
+$NetBSD$
+
+From FreeBSD ports/ DragonFly dports devel/libpthread-stubs
+Unconditionally build libpthread-stubs.la as otherwise
+if all pthread functions found it might not be built.
+
+--- Makefile.in.orig	2009-10-14 09:15:57.000000000 +0000
++++ Makefile.in
+@@ -75,9 +75,9 @@ am__installdirs = "$(DESTDIR)$(libdir)" 
+ LTLIBRARIES = $(lib_LTLIBRARIES)
+ libpthread_stubs_la_LIBADD =
+ am__libpthread_stubs_la_SOURCES_DIST = stubs.c
+-@BUILD_LIB_TRUE@am_libpthread_stubs_la_OBJECTS = stubs.lo
++am_libpthread_stubs_la_OBJECTS = stubs.lo
+ libpthread_stubs_la_OBJECTS = $(am_libpthread_stubs_la_OBJECTS)
+-@BUILD_LIB_TRUE@am_libpthread_stubs_la_rpath = -rpath $(libdir)
++am_libpthread_stubs_la_rpath = -rpath $(libdir)
+ DEFAULT_INCLUDES = -I.@am__isrc@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+@@ -221,8 +221,8 @@ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = pthread-stubs.pc
+-@BUILD_LIB_TRUE@lib_LTLIBRARIES = libpthread-stubs.la
+-@BUILD_LIB_TRUE@libpthread_stubs_la_SOURCES = stubs.c
++lib_LTLIBRARIES = libpthread-stubs.la
++libpthread_stubs_la_SOURCES = stubs.c
+ all: config.h
+ 	$(MAKE) $(AM_MAKEFLAGS) all-am
+ 
diff --git a/libpthread-stubs-dfbsd/libpthread-stubs/patches/patch-stubs.c b/libpthread-stubs-dfbsd/libpthread-stubs/patches/patch-stubs.c
new file mode 100644
index 0000000..3b821ac
--- /dev/null
+++ b/libpthread-stubs-dfbsd/libpthread-stubs/patches/patch-stubs.c
@@ -0,0 +1,46 @@
+$NetBSD$
+
+From FreeBSD ports / DragonFly dports
+
+XXX This is a big hack as we cannot define pthread_condattr_{init,destroy}
+here, or we will conflict with the weak symbols in libthr.  The way our linker
+works, the weak symbols will be resolved here, and pthread_condattr functions
+will not work even in threaded applications.
+
+I am working to get these symbols added to libc, but in the meantime, this
+is needed to avoid crashes in threaded applications which make use of
+pthread_condattr*.
+
+XXX Just comment out everything for tested platforms
+
+--- stubs.c.orig	2009-10-14 09:13:09.000000000 +0000
++++ stubs.c
+@@ -28,10 +28,12 @@
+ #include <stdlib.h>
+ #include "config.h"
+ 
++#if !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__)
++
+ #ifndef HAVE_PTHREAD_SELF
+ #define NEED_ZERO_STUB
+ # ifdef SUPPORT_ATTRIBUTE_ALIAS
+-int pthread_self() __attribute__ ((weak, alias ("__pthread_zero_stub")));
++pthread_t pthread_self() __attribute__ ((weak, alias ("__pthread_zero_stub")));
+ # else
+ #  pragma weak pthread_self = __pthread_zero_stub
+ # endif
+@@ -157,7 +159,7 @@ int pthread_equal() __attribute__ ((weak
+ #ifndef HAVE_PTHREAD_EXIT
+ #define NEED_EXIT_STUB
+ # ifdef SUPPORT_ATTRIBUTE_ALIAS
+-int pthread_exit() __attribute__ ((weak, alias ("__pthread_exit_stub")));
++void pthread_exit(void*) __attribute__ ((weak, alias ("__pthread_exit_stub")));
+ # else
+ #  pragma weak pthread_exit = __pthread_exit_stub
+ # endif
+@@ -190,3 +192,5 @@ static void __pthread_exit_stub(void *re
+     exit(EXIT_SUCCESS);
+ }
+ #endif
++
++#endif /* !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__) */
diff --git a/libpthread-stubs-dfbsd/patches/patch-Makefile.in b/libpthread-stubs-dfbsd/patches/patch-Makefile.in
new file mode 100644
index 0000000..e25a922
--- /dev/null
+++ b/libpthread-stubs-dfbsd/patches/patch-Makefile.in
@@ -0,0 +1,27 @@
+$NetBSD$
+
+--- Makefile.in.orig	2009-10-14 09:15:57.000000000 +0000
++++ Makefile.in
+@@ -75,9 +75,9 @@ am__installdirs = "$(DESTDIR)$(libdir)" 
+ LTLIBRARIES = $(lib_LTLIBRARIES)
+ libpthread_stubs_la_LIBADD =
+ am__libpthread_stubs_la_SOURCES_DIST = stubs.c
+-@BUILD_LIB_TRUE@am_libpthread_stubs_la_OBJECTS = stubs.lo
++am_libpthread_stubs_la_OBJECTS = stubs.lo
+ libpthread_stubs_la_OBJECTS = $(am_libpthread_stubs_la_OBJECTS)
+-@BUILD_LIB_TRUE@am_libpthread_stubs_la_rpath = -rpath $(libdir)
++am_libpthread_stubs_la_rpath = -rpath $(libdir)
+ DEFAULT_INCLUDES = -I.@am__isrc@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+@@ -221,8 +221,8 @@ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = pthread-stubs.pc
+-@BUILD_LIB_TRUE@lib_LTLIBRARIES = libpthread-stubs.la
+-@BUILD_LIB_TRUE@libpthread_stubs_la_SOURCES = stubs.c
++lib_LTLIBRARIES = libpthread-stubs.la
++libpthread_stubs_la_SOURCES = stubs.c
+ all: config.h
+ 	$(MAKE) $(AM_MAKEFLAGS) all-am
+ 
diff --git a/libpthread-stubs-dfbsd/patches/patch-stubs.c b/libpthread-stubs-dfbsd/patches/patch-stubs.c
new file mode 100644
index 0000000..1d0a289
--- /dev/null
+++ b/libpthread-stubs-dfbsd/patches/patch-stubs.c
@@ -0,0 +1,33 @@
+$NetBSD$
+
+--- stubs.c.orig	2009-10-14 09:13:09.000000000 +0000
++++ stubs.c
+@@ -28,10 +28,12 @@
+ #include <stdlib.h>
+ #include "config.h"
+ 
++#if !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__)
++
+ #ifndef HAVE_PTHREAD_SELF
+ #define NEED_ZERO_STUB
+ # ifdef SUPPORT_ATTRIBUTE_ALIAS
+-int pthread_self() __attribute__ ((weak, alias ("__pthread_zero_stub")));
++pthread_t pthread_self() __attribute__ ((weak, alias ("__pthread_zero_stub")));
+ # else
+ #  pragma weak pthread_self = __pthread_zero_stub
+ # endif
+@@ -157,7 +159,7 @@ int pthread_equal() __attribute__ ((weak
+ #ifndef HAVE_PTHREAD_EXIT
+ #define NEED_EXIT_STUB
+ # ifdef SUPPORT_ATTRIBUTE_ALIAS
+-int pthread_exit() __attribute__ ((weak, alias ("__pthread_exit_stub")));
++void pthread_exit(void*) __attribute__ ((weak, alias ("__pthread_exit_stub")));
+ # else
+ #  pragma weak pthread_exit = __pthread_exit_stub
+ # endif
+@@ -190,3 +192,5 @@ static void __pthread_exit_stub(void *re
+     exit(EXIT_SUCCESS);
+ }
+ #endif
++
++#endif /* !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__) */


Home | Main Index | Thread Index | Old Index