On recent CURRENT (FreeBSD 14.0-CURRENT #2 main-n261026-d04c86717c8c: Sun Feb 19 08:45:28 CET 2023 amd64) compiling of port emulators/virtualbox-ose-kmod fails with the error shown below. [...] /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/freebsd.amd64/release/bin/src/vboxdrv/freebsd/SUPDrv-freebsd.c:433:50: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'RTR3PTR' (aka 'unsigned long') [-Wint-conversion] if (RT_FAILURE(RTR0MemUserCopyFrom(&Hdr, pvUser, sizeof(Hdr)))) ^~~~~~ include/iprt/errcore.h:99:58: note: expanded from macro 'RT_FAILURE' #define RT_FAILURE(rc) ( RT_UNLIKELY(!RT_SUCCESS_NP(rc)) ) ^~ include/iprt/errcore.h:80:38: note: expanded from macro 'RT_SUCCESS_NP' # define RT_SUCCESS_NP(rc) ( (int)(rc) >= VINF_SUCCESS ) ^~ include/iprt/cdefs.h:1826:53: note: expanded from macro 'RT_UNLIKELY' # define RT_UNLIKELY(expr) __builtin_expect(!!(expr), 0) ^~~~ include/iprt/mem.h:756:56: note: passing argument to parameter 'R3PtrSrc' here RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb); ^ /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/freebsd.amd64/release/bin/src/vboxdrv/freebsd/SUPDrv-freebsd.c:461:50: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'RTR3PTR' (aka 'unsigned long') [-Wint-conversion] if (RT_FAILURE(RTR0MemUserCopyFrom(pHdr, pvUser, Hdr.cbIn))) ^~~~~~ include/iprt/errcore.h:99:58: note: expanded from macro 'RT_FAILURE' #define RT_FAILURE(rc) ( RT_UNLIKELY(!RT_SUCCESS_NP(rc)) ) ^~ include/iprt/errcore.h:80:38: note: expanded from macro 'RT_SUCCESS_NP' # define RT_SUCCESS_NP(rc) ( (int)(rc) >= VINF_SUCCESS ) ^~ include/iprt/cdefs.h:1826:53: note: expanded from macro 'RT_UNLIKELY' # define RT_UNLIKELY(expr) __builtin_expect(!!(expr), 0) ^~~~ include/iprt/mem.h:756:56: note: passing argument to parameter 'R3PtrSrc' here RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb); ^ /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/freebsd.amd64/release/bin/src/vboxdrv/freebsd/SUPDrv-freebsd.c:494:46: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'RTR3PTR' (aka 'unsigned long') [-Wint-conversion] if (RT_FAILURE(RTR0MemUserCopyTo(pvUser, pHdr, cbOut))) ^~~~~~ include/iprt/errcore.h:99:58: note: expanded from macro 'RT_FAILURE' #define RT_FAILURE(rc) ( RT_UNLIKELY(!RT_SUCCESS_NP(rc)) ) ^~ include/iprt/errcore.h:80:38: note: expanded from macro 'RT_SUCCESS_NP' # define RT_SUCCESS_NP(rc) ( (int)(rc) >= VINF_SUCCESS ) ^~ include/iprt/cdefs.h:1826:53: note: expanded from macro 'RT_UNLIKELY' # define RT_UNLIKELY(expr) __builtin_expect(!!(expr), 0) ^~~~ include/iprt/mem.h:768:41: note: passing argument to parameter 'R3PtrDst' here RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void const *pvSrc, size_t cb); ^
Via <https://www.freshports.org/emulators/virtualbox-ose-kmod/> At a glance, the recent fallout appears similar.
As also posted on list freebsd-emulation@ from https://reviews.llvm.org/D129881 try to add -Wno-error=int-conversion to the ports Makefile CFLAGS (not tested)
(In reply to Jesper Schmitz Mouridsen from comment #2) After adding CFLAGS+= -Wno-error=int-conversion into virtualbox-ose-kmod Makefile port builds without errors. Thanks a lot!
Review for port fix: https://reviews.freebsd.org/D38906
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=f4a869a6424aa8bc32d50642762d9f294c7ce3da commit f4a869a6424aa8bc32d50642762d9f294c7ce3da Author: Joseph Mingrone <jrm@FreeBSD.org> AuthorDate: 2023-03-04 04:31:00 +0000 Commit: Joseph Mingrone <jrm@FreeBSD.org> CommitDate: 2023-03-06 13:15:34 +0000 emulators/virtualbox-ose-kmod: Fix build with LLVM 15 Starting with clang 15, the -Wint-conversion warning diagnostic for implicit int <-> pointer conversions defaults to an error. Use a cast to fix such an error here. See also: https://lists.freebsd.org/archives/freebsd-emulation/2023-February/000431.html https://lists.freebsd.org/archives/freebsd-emulation/2023-February/000460.html PR: 269721 Reported by: fbl@aoek.com, ohartmann@walstatt.org, rkoberman@gmail.com Differential Revision: https://reviews.freebsd.org/D38906 Sponsored by: The FreeBSD Foundation ...ch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
(In reply to Joseph Mingrone from comment #4) It was an incomplete fix. The remaining fix was committed as 7270b8992214. https://cgit.freebsd.org/ports/commit/?id=7270b8992214047dcc21af347cbab98900122450
(In reply to Jung-uk Kim from comment #6) Sorry. I didn't see those errors when testing and `poudriere testport` built fine for me. http://pkg.ftfl.ca/data/14amd64-default/2023-03-06_16h57m27s/logs/virtualbox-ose-kmod-6.1.36.log
Many thanks, and (comment 5): > Sponsored by: The FreeBSD Foundation – these things do not go unnoticed :-)
No fallout for more than three months, I assume that this is fixed. If not, please reopen. Thanks
Tahnk you.