commit | 990c57e50581230e88bcc64976b9773a71f2f18c | [log] [tgz] |
---|---|---|
author | Andrew Jeffery <andrew@aj.id.au> | Tue Apr 04 16:03:06 2017 +0930 |
committer | Florian Friedrich <ffried@me.com> | Fri Apr 21 10:00:36 2017 +0200 |
tree | a3dd507b37768b6761a0d5734a5595790ea03b5d | |
parent | db6a8f61d7a779ba3c7181b1ac017fdad3fd7041 [diff] |
lock: Avoid use of undefined DISPATCH_INTERNAL_CRASH Building swift-corelibs-libdispatch on powerpc64le under Linux lead to the following build failure: /bin/bash ../libtool --tag=CXX --mode=compile /home/ubuntu/swift-dev/build/buildbot_incremental/llvm-linux-powerpc64le/bin/clang++ -DHAVE_CONFIG_H -I. -I../config -I.. -I.. -I../private -DDISPATCH_USE_DTRACE=0 -I../libpwq/include -Wall -fvisibility=hidden -momit-leaf-frame-pointer -isystem /usr/include/bsd -DLIBBSD_OVERLAY -fblocks -I../src/BlocksRuntime -std=gnu++11 -fno-exceptions -O2 -c -o libdispatch_la-block.lo `test -f 'block.cpp' || echo './'`block.cpp libtool: compile: /home/ubuntu/swift-dev/build/buildbot_incremental/llvm-linux-powerpc64le/bin/clang++ -DHAVE_CONFIG_H -I. -I../config -I.. -I.. -I../private -DDISPATCH_USE_DTRACE=0 -I../libpwq/include -Wall -fvisibility=hidden -momit-leaf-frame-pointer -isystem /usr/include/bsd -DLIBBSD_OVERLAY -fblocks -I../src/BlocksRuntime -std=gnu++11 -fno-exce ptions -O2 -c block.cpp -fPIC -DPIC -o .libs/libdispatch_la-block.o In file included from block.cpp:32: In file included from ./internal.h:628: In file included from ./shims.h:171: ./shims/lock.h:550:3: error: use of undeclared identifier 'DISPATCH_INTERNAL_CRASH' DISPATCH_INTERNAL_CRASH(errno, "sys_membarrier not supported"); ^ 1 error generated. Makefile:701: recipe for target 'libdispatch_la-block.lo' failed make[2]: *** [libdispatch_la-block.lo] Error 1 make[2]: Leaving directory '/home/ubuntu/swift-dev/swift-corelibs-libdispatch/src' Makefile:541: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/home/ubuntu/swift-dev/swift-corelibs-libdispatch/src' Makefile:457: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 Include ordering in internal.h is tightly constrained, so open-code the macro to avoid the dependency problem. Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Grand Central Dispatch (GCD or libdispatch) provides comprehensive support for concurrent code execution on multicore hardware.
libdispatch is currently available on all Darwin platforms. This project aims to make a modern version of libdispatch available on all other Swift platforms. To do this, we will implement as much of the portable subset of the API as possible, using the existing open source C implementation.
libdispatch on Darwin is a combination of logic in the xnu
kernel alongside the user-space Library. The kernel has the most information available to balance workload across the entire system. As a first step, however, we believe it is useful to bring up the basic functionality of the library using user-space pthread primitives on Linux. Eventually, a Linux kernel module could be developed to support more informed thread scheduling.
We are currently early in the development of this project. We began with a mirror of the open source drop that corresponds with OS X El Capitan (10.11) and have ported it to x86_64 Ubuntu 14.04 and 15.10. The next steps are:
For detailed instructions on building and installing libdispatch, see INSTALL.md
For detailed instructions on testing libdispatch, see TESTING.md