diff --git a/devel/libdispatch/Makefile b/devel/libdispatch/Makefile index 36b4455b8dad..aca18a54d83b 100644 --- a/devel/libdispatch/Makefile +++ b/devel/libdispatch/Makefile @@ -1,30 +1,35 @@ PORTNAME= libdispatch -DISTVERSIONPREFIX= swift- -DISTVERSION= 5.5 -DISTVERSIONSUFFIX= -RELEASE +DISTVERSION= 5.10.1 PORTEPOCH= 1 CATEGORIES= devel MAINTAINER= fluffy@FreeBSD.org COMMENT= Grand Central Dispatch API support library LICENSE= APACHE20 -USES= cmake +USES= cmake:testing compiler:c++17-lang USE_LDCONFIG= yes USE_CXXSTD= c++17 USE_GITHUB= yes GH_ACCOUNT= apple GH_PROJECT= swift-corelibs-libdispatch +GH_TAGNAME= swift-${DISTVERSION}-RELEASE .include -.if ${OSVERSION} > 1400000 -USES+= llvm:build +#.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400000 && ${OSVERSION} < 1400079 +#USES+= llvm:max=17,build +#USES:= ${USES:Ncompiler\:*} # XXX avoid warnings +#CC= ${_LLVM_MK_PREFIX}/bin/clang +#CPP= ${_LLVM_MK_PREFIX}/bin/clang-cpp +#CXX= ${_LLVM_MK_PREFIX}/bin/clang++ #LD?= ${_LLVM_MK_PREFIX}/bin/ld -.else -USES+= compiler:c++17-lang +#.endif + +.if ${OPSYS} == FreeBSD && ${ARCH} == i386 +CFLAGS+= -Wno-incompatible-function-pointer-types .endif .include diff --git a/devel/libdispatch/distinfo b/devel/libdispatch/distinfo index 89a5a363a7dc..b4d34f8de82d 100644 --- a/devel/libdispatch/distinfo +++ b/devel/libdispatch/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1667817651 -SHA256 (apple-swift-corelibs-libdispatch-swift-5.5-RELEASE_GH0.tar.gz) = 5efdfa1d2897c598acea42fc00776477bb3713645686774f5ff0818b26649e62 -SIZE (apple-swift-corelibs-libdispatch-swift-5.5-RELEASE_GH0.tar.gz) = 592054 +TIMESTAMP = 1723281605 +SHA256 (apple-swift-corelibs-libdispatch-5.10.1-swift-5.10.1-RELEASE_GH0.tar.gz) = affa3544b0fdb60f8f175bc0d2846177436d5848ef8ca73e3e560d23986f38b3 +SIZE (apple-swift-corelibs-libdispatch-5.10.1-swift-5.10.1-RELEASE_GH0.tar.gz) = 594770 diff --git a/devel/libdispatch/files/patch-src_event_event.c b/devel/libdispatch/files/patch-src_event_event.c index 873c9243e688..4ac4d8ec33ff 100644 --- a/devel/libdispatch/files/patch-src_event_event.c +++ b/devel/libdispatch/files/patch-src_event_event.c @@ -1,23 +1,11 @@ ---- src/event/event.c.orig 2021-09-17 04:54:52 UTC +--- src/event/event.c.orig 2023-06-15 00:55:45 UTC +++ src/event/event.c -@@ -766,9 +766,9 @@ _dispatch_timer_heap_update(dispatch_timer_heap_t dth, - #pragma mark timer unote - - #define _dispatch_timer_du_debug(what, du) \ -- _dispatch_debug("kevent-source[%p]: %s kevent[%p] { ident = 0x%x }", \ -+ _dispatch_debug("kevent-source[%p]: %s kevent[%p] { ident = 0x%llx }", \ - _dispatch_wref2ptr((du)->du_owner_wref), what, \ -- (du), (du)->du_ident) -+ (du), (unsigned long long)(du)->du_ident) - - DISPATCH_ALWAYS_INLINE - static inline unsigned int @@ -792,7 +792,7 @@ _dispatch_timer_unote_disarm(dispatch_timer_source_ref _dispatch_timer_unote_disarm(dispatch_timer_source_refs_t dt, dispatch_timer_heap_t dth) { - uint32_t tidx = dt->du_ident; + uint32_t tidx = (uint32_t)dt->du_ident; dispatch_assert(_dispatch_unote_armed(dt)); _dispatch_timer_heap_remove(&dth[tidx], dt); diff --git a/devel/libdispatch/files/patch-src_shims_lock.c b/devel/libdispatch/files/patch-src_shims_lock.c index c267242cb840..3fafcc2344e7 100644 --- a/devel/libdispatch/files/patch-src_shims_lock.c +++ b/devel/libdispatch/files/patch-src_shims_lock.c @@ -1,119 +1,119 @@ ---- src/shims/lock.c.orig 2021-09-17 04:54:52 UTC +--- src/shims/lock.c.orig 2023-06-15 00:55:45 UTC +++ src/shims/lock.c @@ -56,6 +56,18 @@ _dispatch_thread_switch(dispatch_lock value, dispatch_ #endif #endif +#if defined(__unix__) +DISPATCH_ALWAYS_INLINE +static inline void +_dispatch_thread_switch(dispatch_lock value, dispatch_lock_options_t flags, + uint32_t timeout) +{ + (void)value; + (void)flags; + (void)timeout; +} +#endif + #pragma mark - semaphores #if USE_MACH_SEM -@@ -394,8 +406,10 @@ _dispatch_unfair_lock_wake(uint32_t *uaddr, uint32_t f +@@ -395,8 +407,10 @@ _dispatch_unfair_lock_wake(uint32_t *uaddr, uint32_t f #include #ifdef __ANDROID__ #include -#else +#elif __linux__ #include +#else +#include #endif /* __ANDROID__ */ DISPATCH_ALWAYS_INLINE -@@ -404,7 +418,12 @@ _dispatch_futex(uint32_t *uaddr, int op, uint32_t val, +@@ -405,7 +419,12 @@ _dispatch_futex(uint32_t *uaddr, int op, uint32_t val, const struct timespec *timeout, uint32_t *uaddr2, uint32_t val3, int opflags) { +#if __linux__ return (int)syscall(SYS_futex, uaddr, op | opflags, val, timeout, uaddr2, val3); +#else + (void)val3; + return futex(uaddr, op | opflags, (int)val, timeout, uaddr2); +#endif } // returns 0, ETIMEDOUT, EFAULT, EINTR, EWOULDBLOCK -@@ -414,11 +433,15 @@ _futex_blocking_op(uint32_t *uaddr, int futex_op, uint +@@ -415,11 +434,15 @@ _futex_blocking_op(uint32_t *uaddr, int futex_op, uint const struct timespec *timeout, int flags) { for (;;) { - int rc = _dispatch_futex(uaddr, futex_op, val, timeout, NULL, 0, flags); - if (!rc) { + int err = _dispatch_futex(uaddr, futex_op, val, timeout, NULL, 0, flags); + if (!err) { return 0; } - switch (errno) { +#if __linux__ + // syscall sets errno to communicate error code. + err = errno +#endif + switch (err) { case EINTR: /* * if we have a timeout, we need to return for the caller to -@@ -454,6 +477,7 @@ _dispatch_futex_wake(uint32_t *uaddr, int wake, int op +@@ -455,6 +478,7 @@ _dispatch_futex_wake(uint32_t *uaddr, int wake, int op DISPATCH_INTERNAL_CRASH(errno, "_dlock_wake() failed"); } +#if HAVE_FUTEX_PI static void _dispatch_futex_lock_pi(uint32_t *uaddr, struct timespec *timeout, int detect, int opflags) -@@ -471,6 +495,7 @@ _dispatch_futex_unlock_pi(uint32_t *uaddr, int opflags +@@ -472,6 +496,7 @@ _dispatch_futex_unlock_pi(uint32_t *uaddr, int opflags if (rc == 0) return; DISPATCH_CLIENT_CRASH(errno, "futex_unlock_pi() failed"); } +#endif #endif #pragma mark - wait for address -@@ -509,6 +534,19 @@ _dispatch_wait_on_address(uint32_t volatile *_address, - return _dispatch_futex_wait(address, value, NULL, FUTEX_PRIVATE_FLAG); - #elif defined(_WIN32) - return WaitOnAddress(address, &value, sizeof(value), INFINITE) == TRUE; +@@ -516,6 +541,19 @@ _dispatch_wait_on_address(uint32_t volatile *_address, + ? INFINITE : ((nsecs + 1000000) / 1000000); + if (dwMilliseconds == 0) return ETIMEDOUT; + return WaitOnAddress(address, &value, sizeof(value), dwMilliseconds) == TRUE; +#elif defined(__FreeBSD__) + uint64_t usecs = 0; + int rc; + if (nsecs == DISPATCH_TIME_FOREVER) { + return _dispatch_ulock_wait(address, value, 0, flags); + } + do { + usecs = howmany(nsecs, NSEC_PER_USEC); + if (usecs > UINT32_MAX) usecs = UINT32_MAX; + rc = _dispatch_ulock_wait(address, value, (uint32_t)usecs, flags); + } while (usecs == UINT32_MAX && rc == ETIMEDOUT && + (nsecs = _dispatch_timeout(timeout)) != 0); + return rc; #else #error _dispatch_wait_on_address unimplemented for this platform #endif -@@ -599,7 +637,7 @@ _dispatch_unfair_lock_lock_slow(dispatch_unfair_lock_t +@@ -606,7 +644,7 @@ _dispatch_unfair_lock_lock_slow(dispatch_unfair_lock_t } } } -#elif HAVE_FUTEX +#elif HAVE_FUTEX_PI void _dispatch_unfair_lock_lock_slow(dispatch_unfair_lock_t dul, dispatch_lock_options_t flags) -@@ -636,7 +674,7 @@ _dispatch_unfair_lock_unlock_slow(dispatch_unfair_lock +@@ -643,7 +681,7 @@ _dispatch_unfair_lock_unlock_slow(dispatch_unfair_lock if (_dispatch_lock_has_waiters(cur)) { _dispatch_unfair_lock_wake(&dul->dul_lock, 0); } -#elif HAVE_FUTEX +#elif HAVE_FUTEX_PI // futex_unlock_pi() handles both OWNER_DIED which we abuse & WAITERS _dispatch_futex_unlock_pi(&dul->dul_lock, FUTEX_PRIVATE_FLAG); #else diff --git a/devel/libdispatch/files/patch-src_source.c b/devel/libdispatch/files/patch-src_source.c deleted file mode 100644 index c812cacf1e11..000000000000 --- a/devel/libdispatch/files/patch-src_source.c +++ /dev/null @@ -1,16 +0,0 @@ ---- src/source.c.orig 2021-09-17 04:54:52 UTC -+++ src/source.c -@@ -1398,11 +1398,11 @@ _dispatch_source_debug_attr(dispatch_source_t ds, char - dispatch_source_refs_t dr = ds->ds_refs; - dispatch_queue_flags_t dqf = _dispatch_queue_atomic_flags(ds); - dispatch_unote_state_t du_state = _dispatch_unote_state(dr); -- return dsnprintf(buf, bufsiz, "target = %s[%p], ident = 0x%x, " -+ return dsnprintf(buf, bufsiz, "target = %s[%p], ident = 0x%llx, " - "mask = 0x%x, pending_data = 0x%llx, registered = %d, " - "armed = %d, %s%s%s", - target && target->dq_label ? target->dq_label : "", target, -- dr->du_ident, dr->du_fflags, (unsigned long long)dr->ds_pending_data, -+ (unsigned long long)dr->du_ident, dr->du_fflags, (unsigned long long)dr->ds_pending_data, - _du_state_registered(du_state), _du_state_armed(du_state), - (dqf & DSF_CANCELED) ? "cancelled, " : "", - (dqf & DSF_NEEDS_EVENT) ? "needs-event, " : "", diff --git a/devel/libdispatch/pkg-plist b/devel/libdispatch/pkg-plist index 5646e32d7286..33b2867e0f47 100644 --- a/devel/libdispatch/pkg-plist +++ b/devel/libdispatch/pkg-plist @@ -1,35 +1,36 @@ include/Block.h include/dispatch/base.h include/dispatch/block.h include/dispatch/data.h include/dispatch/dispatch.h include/dispatch/group.h include/dispatch/introspection.h include/dispatch/io.h include/dispatch/object.h include/dispatch/once.h include/dispatch/queue.h include/dispatch/semaphore.h include/dispatch/source.h include/dispatch/time.h +include/os/generic_base.h include/os/generic_unix_base.h include/os/generic_win_base.h include/os/object.h lib/libBlocksRuntime.so lib/libdispatch.so share/man/man3/dispatch.3.gz share/man/man3/dispatch_after.3.gz share/man/man3/dispatch_api.3.gz share/man/man3/dispatch_apply.3.gz share/man/man3/dispatch_async.3.gz share/man/man3/dispatch_data_create.3.gz share/man/man3/dispatch_group_create.3.gz share/man/man3/dispatch_io_create.3.gz share/man/man3/dispatch_io_read.3.gz share/man/man3/dispatch_object.3.gz share/man/man3/dispatch_once.3.gz share/man/man3/dispatch_queue_create.3.gz share/man/man3/dispatch_read.3.gz share/man/man3/dispatch_semaphore_create.3.gz share/man/man3/dispatch_source_create.3.gz share/man/man3/dispatch_time.3.gz