app-emulation/virtualbox-modules does not build on linux-next because VM_RESERVED flag got removed from include/linux/mm.h
To achieve same behavior a combination of `VM_DONTEXPAND | VM_DONTDUMP` could be used. I have attached a patch which does exactly that.
Created attachment 322300 [details, diff]
This probably needs to be sent upstream instead
Probably but trying to open virtualbox.org gives me:
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/trac/web/api.py", line 436, in send_error
File "/usr/lib/python2.4/site-packages/trac/web/chrome.py", line 803, in render_template
message = req.session.pop('chrome.%s.%d' % (type_, i))
File "/usr/lib/python2.4/site-packages/trac/web/api.py", line 212, in __getattr__
So I post a patch here in case someone faces the same problem.
And overall I cannot find a public repository virtualbox-modules are developed in. Anyone knows?
The removal of the VM_RESERVED flag has now been merged into v3.7-rc1. So this issue now applies to git-sources-3.7-rc1 as well.
Created attachment 332100 [details, diff]
VM_RESERVED replaced by (VM_DONTEXPAND | VM_DONTDUMP
In kernel 3.7, the flag VM_RESERVED is removed, and should be replaced by (VM_DONTEXPAND | VM_DONTDUMP).
Or you could make a more "official" patch from vbox changeset 43637.
The linked upstream patch is already included in the latest 4.2.4 version, however it still doesn't work. Please include the patch in attachment, or modify the conditional checks to check "#ifdef VM_RESERVED" before using it.
I found the cause of this for me at least.
I use upstream kernel kept updated using git. It looks like for 3.7 include/linux/version.h stopped getting generated so I had a stale file causing the macro in the virtualbox-modules sources to think I had a pre 3.7 kernel.
'make mrproper' does not remove the version.h file.
I manually removed it and rebuilt the 3.7 kernel. The file was not regenerated. I was then able to compile virtualbox-modules without issue.
Looks like upstream kernel commit da01ee3c8e7954fb7ed0ceb002d482c79f8b2ccd will resolve this for everyone using git to pull the kernel, but is not currently in the 3.7 stable tree.
Trevor's answer was spot on for me as well. Thanks.
I don't use a git kernel. But deleting include/linux/version.h in the build directory allowed me to emerge both app-emulation/virtualbox-modules-4.2.16 and app-emulation/virtualbox-modules-4.2.18.
Is this still a problem with 4.2.18?
This is fixed in all versions still in the tree:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
vma->vm_flags |= VM_RESERVED;