Re: problem building virtualbox-ose-kmod

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Tue, 26 Jan 2021 22:29:29 +1000
Moin!

Stefan, please add check for __FreeBSD_version and fill PR or commit it directly with ports-secteam approval.

--
Dima. (desktop, kde, x11, office, ports-secteam)_at_FreeBSD team
(fluffy_at_FreeBSD.org, https://t.me/dima_panov)

> On Tuesday, Jan 26, 2021 at 8:37 PM, Stefan Esser <se_at_freebsd.org (mailto:se_at_freebsd.org)> wrote:
> Am 26.01.21 um 07:34 schrieb monochrome:
> > having this issue building virtualbox-ose-kmod, its been like this for a
> > while but I deinstalled and forgot, for quite a while now, maybe over a
> > month. now that I've moved from 13-current to stable/13 I thought I
> > would try to put it back, but it still wont build. I haven't seen anyone
> > else with this problem, did I miss a memo?
>
> I have sent a patch to vbox_at_on 2020-01-16, but only received an
> automatic reply that it had to be accepted by the moderator of the
> list (and never got any further reply or reaction on it).
>
> The signature of vm_map_protect() has changed, but the port has not
> been updated.
>
> Here is the patch in case the attachment gets stripped (but probably
> with messed-up white-space):
>
> Index: files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c
> ===================================================================
> --- files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c
> (revision 561738)
> +++ files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c
> (working copy)
> _at__at_ -421,7 +421,8 _at__at_
> _at__at_ -826,6 +885,7 _at__at_ DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINT
> ProtectionFlags |= VM_PROT_EXECUTE;
>
> - int krc = vm_map_protect(pVmMap, AddrStart, AddrEnd,
> ProtectionFlags, FALSE);
> +- int krc = vm_map_protect(pVmMap, AddrStart, AddrEnd,
> ProtectionFlags, FALSE);
> ++ int krc = vm_map_protect(pVmMap, AddrStart, AddrEnd,
> ProtectionFlags, 0, VM_MAP_PROTECT_SET_PROT);
> + IPRT_FREEBSD_RESTORE_EFL_AC();
> if (krc == KERN_SUCCESS)
> return VINF_SUCCESS;
>
> Seems that __FreeBSD_version has been bumped to 1300135 less than
> 2 hours before 0659df6faddfb27ba54a2cae2a12552cf4f823a0 and thus
> the patch could be made to depend on that __FreeBSD_version value,
> but I did not bother to add the condition since all my systems have
> been updated to newer versions.
>
> Regards, STefan
>
> > --- memobj-r0drv-freebsd.o ---
> > /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-5.2.44/out/freebsd.amd64/release/bin/src/vboxdrv/r0drv/freebsd/memobj-r0drv-freebsd.c:887:80:
> > error: too few arguments to function call, expected 6, have 5
> > int krc = vm_map_protect(pVmMap, AddrStart, AddrEnd,
> > ProtectionFlags, FALSE);
> > ~~~~~~~~~~~~~~ ^
> > /usr/src/sys/vm/vm_map.h:517:5: note: 'vm_map_protect' declared here
> > int vm_map_protect(vm_map_t map, vm_offset_t start, vm_offset_t end,
> > ^
> > 1 error generated.
> > *** [memobj-r0drv-freebsd.o] Error code 1

Received on Tue Jan 26 2021 - 11:29:35 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:27 UTC