Bug 252675 - emulators/virtualbox-ose-kmod: build failure/compiler error: 'vm_map_protect' declared here
Summary: emulators/virtualbox-ose-kmod: build failure/compiler error: 'vm_map_protect'...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Virtualbox Team (Nobody)
URL:
Keywords:
: 252953 253029 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-01-14 16:36 UTC by O. Hartmann
Modified: 2021-01-26 19:06 UTC (History)
10 users (show)

See Also:
bugzilla: maintainer-feedback? (vbox)
madpilot: merge-quarterly+


Attachments
patch (1.46 KB, patch)
2021-01-17 22:16 UTC, rozhuk.im
rozhuk.im: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2021-01-14 16:36:01 UTC
On recent CURRENT (FreeBSD 13.0-ALPHA1 #19 main-c255955-g37bd3aa6fac8: Thu Jan 14 17:12:23 CET 2021 amd64) building port emulators/virtualbox-ose-kmod fails due to the error shown below:

[...]

--- memobj-r0drv-freebsd.o ---
nostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length   -mno-aes -mno-avx  -std=iso9899:1999 -c /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-5.2.44/out/freebsd.amd64/release/bin/src/vboxdrv/r0drv/freebsd/memobj-r0drv-freebsd.c -o 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
Comment 1 Steve Wills freebsd_committer 2021-01-14 16:47:44 UTC
This may be related to:

https://cgit.freebsd.org/src/commit/?id=0659df6faddfb27ba54a2cae2a12552cf4f823a0
Comment 2 rozhuk.im 2021-01-17 22:16:21 UTC
Created attachment 221687 [details]
patch

Not sure that VM_MAP_PROTECT_SET_PROT must be here, probably VM_MAP_PROTECT_SET_MAXPROT.
At least this allow build.
Comment 3 Trond.Endrestol 2021-01-19 19:51:35 UTC
Here's another instance not corrected by the above patch:

--- memobj-r0drv-freebsd.o ---
/construction/xports/emulators/virtualbox-ose-kmod/work/VirtualBox-5.2.44/out/freebsd.amd64/release/bin/src/vboxdrv/r0drv/freebsd/memobj-r0drv-freebsd.c:890: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
Comment 4 Trond.Endrestol 2021-01-19 20:01:57 UTC
(In reply to Trond.Endrestol from comment #3)
The patch is off by 1. The change to vm_map_protect() affects version 1300135.
Comment 5 olevole 2021-01-23 19:10:12 UTC
(In reply to rozhuk.im from comment #2)

works fine for me. tested on FreeBSD 13.0-ALPHA2 gf76393a6305
Comment 6 Guido Falsi freebsd_committer 2021-01-25 18:07:49 UTC
*** Bug 252953 has been marked as a duplicate of this bug. ***
Comment 7 Guido Falsi freebsd_committer 2021-01-25 18:11:03 UTC
I submitted a similar patch on bug #252953. My patch references version 1300135 as affected, but otherwise is the same.

I tested my patch in poudriere with all supported versions and it runs fine on my machine (14.0-CURRENT main-c256228-g0d528e63541).

BTW this should be committed quickly and also merged to to quarterly 2021Q1, to ensure a working package for 13.0-RELEASE.
Comment 8 commit-hook freebsd_committer 2021-01-26 14:49:57 UTC
A commit references this bug:

Author: madpilot
Date: Tue Jan 26 14:49:23 UTC 2021
New revision: 562683
URL: https://svnweb.freebsd.org/changeset/ports/562683

Log:
  Fix VirtualBox build on recent head and 13 after src commit
  0659df6faddf

  PR:		252675
  Submitted by:	O. Hartmann <ohartmann@walstatt.org>
  		Mateusz Piotrowski <0mp@FreeBSD.org> (duplicate)
  Reported by:	se (mailing lists), others
  Approved by:	ports-secteam (fluffy)
  MFH:		2020Q1

Changes:
  head/emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c
Comment 9 commit-hook freebsd_committer 2021-01-26 14:52:00 UTC
A commit references this bug:

Author: madpilot
Date: Tue Jan 26 14:51:10 UTC 2021
New revision: 562684
URL: https://svnweb.freebsd.org/changeset/ports/562684

Log:
  MFH: r562683

  Fix VirtualBox build on recent head and 13 after src commit
  0659df6faddf

  PR:		252675
  Submitted by:	O. Hartmann <ohartmann@walstatt.org>
  		Mateusz Piotrowski <0mp@FreeBSD.org> (duplicate)
  Reported by:	se (mailing lists), others
  Approved by:	ports-secteam (fluffy)

Changes:
_U  branches/2021Q1/
  branches/2021Q1/emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c
Comment 10 Guido Falsi freebsd_committer 2021-01-26 15:30:57 UTC
Fix committed and merged to quarterly.
Comment 11 Guido Falsi freebsd_committer 2021-01-26 18:38:34 UTC
*** Bug 253029 has been marked as a duplicate of this bug. ***