debian/0000755000000000000000000000000012011212755007162 5ustar debian/changelog0000644000000000000000000000454512011212752011041 0ustar libdispatch (0~svn197-3.1ubuntu1) quantal; urgency=low * Resynchronise with Debian. Remaining changes: - Strip --param=ssp-buffer-size=4 from CFLAGS; clang doesn't support it and so we end up omitting Blocks support. - Strip -fstack-protector from CFLAGS; this causes a link failure with clang on at least some architectures. - Fix build with 'ld --no-add-needed'. -- Colin Watson Fri, 10 Aug 2012 15:08:39 +0100 libdispatch (0~svn197-3.1) unstable; urgency=low * Non-maintainer upload. * Fix use SSE2 instructions in i386. (Closes: #660806) -- Nobuhiro Iwamatsu Tue, 10 Jul 2012 02:05:06 +0900 libdispatch (0~svn197-3ubuntu1) precise; urgency=low * Strip --param=ssp-buffer-size=4 from CFLAGS; clang doesn't support it and so we end up omitting Blocks support (LP: #935090). * Strip -fstack-protector from CFLAGS; this causes a link failure with clang on at least some architectures. * Fix build with 'ld --no-add-needed'. -- Colin Watson Mon, 23 Apr 2012 13:43:20 +0100 libdispatch (0~svn197-3) unstable; urgency=low * Replace individual patches with a combined libdispatch-r197_v2 patch. * Add workaround for eglibc bug #631888. * The configure script now defaults to Clang if it is available. -- Mark Heily Tue, 28 Jun 2011 22:20:40 -0400 libdispatch (0~svn197-2) unstable; urgency=low * Require clang >= 2.8 * patches/dispatch_main: prevent the process from becoming a zombie. * patches/__builtin_expect: removed due to use of >= 2.8 * patches/use_libm: removed due to use of clang >= 2.8 * Add a Build-Depends on dh-autoreconf, and enable this in debian/rules -- Mark Heily Wed, 18 May 2011 22:28:58 -0400 libdispatch (0~svn197-1) unstable; urgency=low * Upgrade to r197 from the upstream source repository. * Remove all Debian-specific patches. * Remove libbsd as a dependency. * Add a dependency on libpthread-workqueue. -- Mark Heily Sun, 6 Mar 2011 15:31:39 -0400 libdispatch (0~svn188-2) unstable; urgency=low * Add pkg-config as a dependency (fixes FTBFS) -- Mark Heily Tue, 13 Jul 2010 22:45:01 -0400 libdispatch (0~svn188-1) unstable; urgency=low * Initial upload (Closes: #576638) -- Mark Heily Mon, 05 Apr 2010 23:00:34 -0400 debian/rules0000755000000000000000000000036012011212672010237 0ustar #!/usr/bin/make -f export CFLAGS := $(shell DEB_CFLAGS_MAINT_STRIP='-fstack-protector --param=ssp-buffer-size=4' dpkg-buildflags --get CFLAGS) #override_dh_auto_configure: # CC=clang ./configure --prefix=/usr %: dh $@ --with autoreconf debian/libdispatch0.install0000644000000000000000000000006411566336476013145 0ustar usr/lib/libdispatch.so.* usr/lib/libdispatch.so.*.* debian/compat0000644000000000000000000000000211566336476010405 0ustar 7 debian/source/0000755000000000000000000000000011776607620010502 5ustar debian/source/format0000644000000000000000000000001411566336476011715 0ustar 3.0 (quilt) debian/control0000644000000000000000000000246212011212672010567 0ustar Source: libdispatch Priority: extra Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Mark Heily Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 7.0.50~), dh-autoreconf, libblocksruntime0, libblocksruntime-dev, libkqueue0, libkqueue-dev, libpthread-workqueue-dev, autotools-dev, pkg-config, libtool, clang (>= 2.8) Standards-Version: 3.9.2 Section: libs Homepage: http://libdispatch.macosforge.org/ Package: libdispatch-dev Section: libdevel Architecture: any Depends: libdispatch0 (= ${binary:Version}), ${misc:Depends}, libkqueue-dev, libblocksruntime-dev, libpthread-workqueue-dev Recommends: clang Description: development files for the Grand Central Dispatch API The libdispatch project consists of the user space implementation of the Grand Central Dispatch API as seen in Mac OS X version 10.6 (Snow Leopard). . This package contains the headers, manpages, and other files needed to build programs that use libdispatch. Package: libdispatch0 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: user space implementation of the Grand Central Dispatch API The libdispatch project consists of the user space implementation of the Grand Central Dispatch API as seen in Mac OS X version 10.6 (Snow Leopard). debian/patches/0000755000000000000000000000000012011212672010607 5ustar debian/patches/disable_dispatch_read.patch0000644000000000000000000000105611603503054016112 0ustar Description: disable the dispatch_read unit test which needs libkqueue 2.0a Author: Mark Heily Index: libdispatch-0~svn197/testing/dispatch_read.c =================================================================== --- libdispatch-0~svn197.orig/testing/dispatch_read.c 2011-07-01 22:44:18.000000000 -0400 +++ libdispatch-0~svn197/testing/dispatch_read.c 2011-07-01 22:44:33.000000000 -0400 @@ -42,6 +42,8 @@ test_start("Dispatch Source Read"); + exit(0); + int infd = open(path, O_RDONLY); if (infd == -1) { perror(path); debian/patches/testing-linkage.patch0000644000000000000000000000114212011212672014713 0ustar Description: Fix build with 'ld --no-add-needed' Author: Colin Watson Bug-Debian: http://bugs.debian.org/660671 Forwarded: no Last-Update: 2012-04-23 Index: b/testing/Makefile.am =================================================================== --- a/testing/Makefile.am +++ b/testing/Makefile.am @@ -81,7 +81,7 @@ noinst_PROGRAMS+=$(TOOLS) INCLUDES=-I$(top_builddir) -I$(top_srcdir) -LDADD=libtest.la ../src/libdispatch.la +LDADD=libtest.la ../src/libdispatch.la ../src/libshims.la CFLAGS=-Wall $(MARCH_FLAGS) $(CBLOCKS_FLAGS) CXXFLAGS=-Wall $(MARCH_FLAGS) $(CXXBLOCKS_FLAGS) debian/patches/libdispatch-r197_v2.patch0000644000000000000000000001032711602504332015232 0ustar Index: libdispatch-0~svn197/configure.ac =================================================================== --- libdispatch-0~svn197.orig/configure.ac 2011-06-28 22:06:58.000000000 -0400 +++ libdispatch-0~svn197/configure.ac 2011-06-28 22:07:19.000000000 -0400 @@ -8,6 +8,7 @@ AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADER([config/config.h]) AC_CONFIG_MACRO_DIR([m4]) +AC_PROG_CC([clang gcc cc]) AC_USE_SYSTEM_EXTENSIONS AM_MAINTAINER_MODE @@ -112,7 +113,6 @@ ) AC_USE_SYSTEM_EXTENSIONS -AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LIBTOOL Index: libdispatch-0~svn197/m4/private-extern.m4 =================================================================== --- libdispatch-0~svn197.orig/m4/private-extern.m4 2011-06-28 22:06:52.000000000 -0400 +++ libdispatch-0~svn197/m4/private-extern.m4 2011-06-28 22:07:19.000000000 -0400 @@ -19,7 +19,15 @@ [dispatch_cv_private_extern=yes], [dispatch_cv_private_extern=no])]) -if test $dispatch_cv_private_extern = yes; then +if test $host_os = "linux-gnu" ; then + # + # WORKAROUND: Building with clang and the GNU linker causes this error: + # + # /usr/bin/ld: .libs/libdispatch_la-apply.o: relocation R_X86_64_PC32 against symbol `_dispatch_hw_config' can not be used when making a shared object; recompile with -fPIC + # + AC_DEFINE([__private_extern__], [extern], + [Define to a replacement for __private_extern]) +elif test $dispatch_cv_private_extern = yes; then AC_DEFINE(HAVE_PRIVATE_EXTERN, 1, Define if __private_extern__ present) elif test $dispatch_cv_hidden_visibility_attribute = yes; then AC_DEFINE(HAVE_PRIVATE_EXTERN, 1, Define if __private_extern__ present) Index: libdispatch-0~svn197/src/queue.c =================================================================== --- libdispatch-0~svn197.orig/src/queue.c 2011-06-28 22:07:04.000000000 -0400 +++ libdispatch-0~svn197/src/queue.c 2011-06-28 22:07:19.000000000 -0400 @@ -23,6 +23,8 @@ #include "protocol.h" #endif +static void _dispatch_queue_cleanup(void *ctxt); + void dummy_function(void) { @@ -377,7 +379,7 @@ // The first xchg on the tail will tell the enqueueing thread that it // is safe to blindly write out to the head pointer. A cmpxchg honors // the algorithm. - dispatch_atomic_cmpxchg(&dq->dq_items_head, mediator, NULL); + (void) dispatch_atomic_cmpxchg(&dq->dq_items_head, mediator, NULL); _dispatch_debug("no work on global work queue"); return NULL; } @@ -474,12 +476,13 @@ _dispatch_hw_config.cc_max_physical = _dispatch_hw_config.cc_max_active; #elif HAVE_SYSCONF && defined(_SC_NPROCESSORS_ONLN) - _dispatch_hw_config.cc_max_active = (int)sysconf(_SC_NPROCESSORS_ONLN); - if (_dispatch_hw_config.cc_max_active < 0) - _dispatch_hw_config.cc_max_active = 1; + int ret; + + ret = (int)sysconf(_SC_NPROCESSORS_ONLN); + _dispatch_hw_config.cc_max_logical = _dispatch_hw_config.cc_max_physical = - _dispatch_hw_config.cc_max_active; + _dispatch_hw_config.cc_max_active = (ret < 0) ? 1 : ret; #else #warning "_dispatch_queue_set_width_init: no supported way to query CPU count" _dispatch_hw_config.cc_max_logical = @@ -941,8 +944,33 @@ if (pthread_main_np()) { #endif _dispatch_program_is_probably_callback_driven = true; - pthread_exit(NULL); - DISPATCH_CRASH("pthread_exit() returned"); +#if defined(__linux__) + /* + * Workaround for a GNU/Linux bug that causes the process to + * become a zombie when the main thread calls pthread_exit(). + */ + sigset_t mask; + void *p; + + p = pthread_getspecific(dispatch_queue_key); + if (p != NULL) + _dispatch_queue_cleanup(p); + p = pthread_getspecific(dispatch_sema4_key); + if (p != NULL) + _dispatch_release(p); + p = pthread_getspecific(dispatch_cache_key); + if (p != NULL) + _dispatch_cache_cleanup2(p); + + sigfillset(&mask); + pthread_sigmask(SIG_SETMASK, &mask, NULL); + for (;;) { + pause(); + } +#else /* !defined(__linux__) */ + pthread_exit(NULL); + DISPATCH_CRASH("pthread_exit() returned"); +#endif #if HAVE_PTHREAD_MAIN_NP } DISPATCH_CLIENT_CRASH("dispatch_main() must be called on the main thread"); debian/patches/avoid-mfence-on-i386.patch0000644000000000000000000000176711776610714015321 0ustar Description: Fix use SSE2 instructions in i386. libdispatch0 uses SSE2 instructions ("MFENCE") which are not available on a Pentium 3. This patch fix this problem. Bug-Debian: http://bugs.debian.org/660806 Forwarded: None Author: Stefan Bühler Last-Update: 2012-07-10 Index: libdispatch-0~svn197/src/hw_shims.h =================================================================== --- libdispatch-0~svn197.orig/src/hw_shims.h 2010-12-24 07:30:44.000000000 -0800 +++ libdispatch-0~svn197/src/hw_shims.h 2012-02-23 05:03:21.910448577 -0800 @@ -48,7 +48,7 @@ #define dispatch_atomic_sub(p, v) __sync_sub_and_fetch((p), (v)) #define dispatch_atomic_or(p, v) __sync_fetch_and_or((p), (v)) #define dispatch_atomic_and(p, v) __sync_fetch_and_and((p), (v)) -#if defined(__i386__) || defined(__x86_64__) +#if 0 && defined(__i386__) || defined(__x86_64__) /* GCC emits nothing for __sync_synchronize() on i386/x86_64. */ #define dispatch_atomic_barrier() __asm__ __volatile__("mfence") #else debian/patches/series0000644000000000000000000000014712011212672012026 0ustar libdispatch-r197_v2.patch disable_dispatch_read.patch avoid-mfence-on-i386.patch testing-linkage.patch debian/copyright0000644000000000000000000000514711566336476011151 0ustar This package was debianized by Mark Heily on Mon, 05 Apr 2010 23:00:34 -0400. It was downloaded from http://svn.macosforge.org/repository/libdispatch/trunk/ Upstream Author(s): Apple Inc. Copyright: Copyright (c) 2008-2009 Apple Inc. All rights reserved. License: Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. On Debian systems, the complete text of the Apache version 2.0 license can be found in `/usr/share/common-licenses/Apache-2.0'. src/shims/pthread_workqueue.[ch] are licensed as follows: /*- * Copyright (c) 2010, Mark Heily * Copyright (c) 2009, Stacey Son * Copyright (c) 2000-2008, Apple Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice unmodified, this list of conditions, and the following * disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ The Debian packaging is: Copyright (C) 2010 Mark Heily and is licensed under the Apache version 2.0 license, see `/usr/share/common-licenses/Apache-2.0'. debian/libdispatch-dev.install0000644000000000000000000000013111566336476013634 0ustar usr/lib/libdispatch.so usr/lib/libdispatch.a usr/include/dispatch/* usr/share/man/man3/*