Bug 252953 - emulators/virtualbox-ose-kmod: Fails to build after recent changes to vm_map_protect(9)
Summary: emulators/virtualbox-ose-kmod: Fails to build after recent changes to vm_map_...
Status: Closed DUPLICATE of bug 252675
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Virtualbox Team (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-23 19:51 UTC by Mateusz Piotrowski
Modified: 2021-01-25 18:07 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (vbox)
0mp: merge-quarterly?


Attachments
Untested patch (2.28 KB, patch)
2021-01-24 16:17 UTC, Guido Falsi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mateusz Piotrowski freebsd_committer freebsd_triage 2021-01-23 19:51:21 UTC
The signature of the vm_map_protect(9) function has been changed in 0659df6faddfb27ba54a2cae2a12552cf4f823a0.

The build produces the following log:

```
/usr/home/0mp/.local/share/freebsd/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/home/0mp/.local/share/freebsd/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
```
Comment 1 Guido Falsi freebsd_committer freebsd_triage 2021-01-24 16:17:29 UTC
Created attachment 221880 [details]
Untested patch

I have an untested patch I'm attaching.

I'm going to test it myself later. My machines are busy right now and testing this has to wait.

The commit causing the failure is 0659df6faddf on src. By looking at the changes in that commit I corrected the vm_map_protect call.

I wrapped it in a check on __FreeBSD_version choosing the nearest one.

I'll report back once I have tested this patch myself.
Comment 2 Mateusz Piotrowski freebsd_committer freebsd_triage 2021-01-24 18:03:42 UTC
I've successfully build virtualbox-ose and virtualbox-ose-kmod with this patch. Thanks a lot!

Just in case, I'm running FreeBSD 14.0-CURRENT #5 main-c256217-g6c789c55c4ba.
Comment 3 Guido Falsi freebsd_committer freebsd_triage 2021-01-25 18:07:49 UTC
I now noticed bug #252675 about this same issue, marking this one as duplicate.

*** This bug has been marked as a duplicate of bug 252675 ***