head 1.2; access; symbols pkgsrc-2020Q1:1.1.0.6 pkgsrc-2020Q1-base:1.1 pkgsrc-2019Q4:1.1.0.8 pkgsrc-2019Q4-base:1.1 pkgsrc-2019Q3:1.1.0.4 pkgsrc-2019Q3-base:1.1 pkgsrc-2019Q2:1.1.0.2; locks; strict; comment @# @; 1.2 date 2020.04.03.20.05.41; author nia; state dead; branches; next 1.1; commitid QWBlaibMX1MPFY2C; 1.1 date 2019.08.06.08.50.28; author maya; state Exp; branches 1.1.2.1; next ; commitid Tv2HyL7StROVFWxB; 1.1.2.1 date 2019.08.06.08.50.28; author bsiegert; state dead; branches; next 1.1.2.2; commitid Lsy7hwCrM6GOMtyB; 1.1.2.2 date 2019.08.10.12.32.34; author bsiegert; state Exp; branches; next ; commitid Lsy7hwCrM6GOMtyB; desc @@ 1.2 log @libusb1: Update to 1.0.23 2019-08-28: v1.0.23 * Add German translation (#446) * Add Hungarian translation (#493) * Android: Improved support for Android * BSD: Remove infinite recursion in OpenBSD backend * configure.ac: Fix detection of clock_gettime library (#439) * Core: abandon synchronous transfers when device closure is detected. * Core: fix error in handling the removal of file descriptors while handling events. * Darwin(macOS): Switch from using ResetDevice to USBDeviceReEnumerate (#455) * Darwin(macOS): Remove code that changed the device class used (#428) * Darwin(macOS): Reduce hotplug timeout to 1ms (from 5s) * New API libusb_set_log_cb() to redirect global and per context log messages to the provided log handling function * New API libusb_wrap_sys_device to allow the user to specify the usb device to use. * Solaris: Break infinite recursion in backend clock_gettime * Solaris: Enable timerfd on sunos when available * Windows: Add support for isochronous transfers with WinUSB * Various other bug fixes and improvements @ text @$NetBSD: patch-ub,v 1.1 2019/08/06 08:50:28 maya Exp $ Avoid undefined behaviour that breaks clang --- libusb/descriptor.c.orig 2019-08-02 09:59:25.784968424 +0900 +++ libusb/descriptor.c 2019-08-02 09:59:44.009134412 +0900 @@@@ -54,7 +54,9 @@@@ for (cp = descriptor; *cp; cp++) { switch (*cp) { case 'b': /* 8-bit byte */ - *dp++ = *sp++; + memcpy(dp, sp, 1); + dp += 1; + sp += 1; break; case 'w': /* 16-bit word, convert from little endian to CPU */ dp += ((uintptr_t)dp & 1); /* Align to word boundary */ @@@@ -63,7 +65,7 @@@@ memcpy(dp, sp, 2); } else { w = (sp[1] << 8) | sp[0]; - *((uint16_t *)dp) = w; + memcpy(dp, &w, 4); } sp += 2; dp += 2; @@@@ -76,7 +78,7 @@@@ } else { d = (sp[3] << 24) | (sp[2] << 16) | (sp[1] << 8) | sp[0]; - *((uint32_t *)dp) = d; + memcpy(dp, &d, 4); } sp += 4; dp += 4; @ 1.1 log @libusb1: patch some undefined behaviour, disable strict aliasing, change -O2 to -O1 when building with clang. This isn't in a separate hacks.mk file because I think that hides the problem too much, it's an issue with the code in the package, not with the compiler's choices. Fixes functionality when built with clang. From Shingo Nishioka in PR pkg/54441. @ text @d1 1 a1 1 $NetBSD$ @ 1.1.2.1 log @file patch-ub was added on branch pkgsrc-2019Q2 on 2019-08-10 12:32:34 +0000 @ text @d1 36 @ 1.1.2.2 log @Pullup ticket #6027 - requested by maya devel/libusb1: clang build fix Revisions pulled up: - devel/libusb1/Makefile 1.19 - devel/libusb1/distinfo 1.11 - devel/libusb1/patches/patch-ub 1.1 --- Module Name: pkgsrc Committed By: maya Date: Tue Aug 6 08:50:28 UTC 2019 Modified Files: pkgsrc/devel/libusb1: Makefile distinfo Added Files: pkgsrc/devel/libusb1/patches: patch-ub Log Message: libusb1: patch some undefined behaviour, disable strict aliasing, change -O2 to -O1 when building with clang. This isn't in a separate hacks.mk file because I think that hides the problem too much, it's an issue with the code in the package, not with the compiler's choices. Fixes functionality when built with clang. >From Shingo Nishioka in PR pkg/54441. @ text @a0 36 $NetBSD: patch-ub,v 1.1 2019/08/06 08:50:28 maya Exp $ Avoid undefined behaviour that breaks clang --- libusb/descriptor.c.orig 2019-08-02 09:59:25.784968424 +0900 +++ libusb/descriptor.c 2019-08-02 09:59:44.009134412 +0900 @@@@ -54,7 +54,9 @@@@ for (cp = descriptor; *cp; cp++) { switch (*cp) { case 'b': /* 8-bit byte */ - *dp++ = *sp++; + memcpy(dp, sp, 1); + dp += 1; + sp += 1; break; case 'w': /* 16-bit word, convert from little endian to CPU */ dp += ((uintptr_t)dp & 1); /* Align to word boundary */ @@@@ -63,7 +65,7 @@@@ memcpy(dp, sp, 2); } else { w = (sp[1] << 8) | sp[0]; - *((uint16_t *)dp) = w; + memcpy(dp, &w, 4); } sp += 2; dp += 2; @@@@ -76,7 +78,7 @@@@ } else { d = (sp[3] << 24) | (sp[2] << 16) | (sp[1] << 8) | sp[0]; - *((uint32_t *)dp) = d; + memcpy(dp, &d, 4); } sp += 4; dp += 4; @