Created attachment 397522 [details] build.log After upgrading the kernel (from 3.17.8-gentoo-r1 to 3.18.7-gentoo) I ran the emerge @x11-module-rebuil and got the error.
Created attachment 397524 [details] emerge --info
Created attachment 397526 [details] emerge -pqv
Created attachment 397528 [details] environment
Created attachment 397530 [details] my /usr/src/linux/.config
Created attachment 397602 [details, diff] Patch that fixes drm_mmap relocation. I've had exactly the same issue after upgrading my kernel to 3.18.7. The reason for this error is that in the kernel the declaration of the drm_mmap function was relocated from drmP.h to drm_legacy.h (see https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/include/drm/drmP.h?id=bfbf3c851ce53b914fe98d60ea3fe3fc1ab75b96). The attached patch fixed this on my system by #including the drm_legacy.h header and changing the drm_mmap references in vboxvideo_drm.c to drm_legacy_mmap. But I guess the fact that drm_mmap has been moved into a legacy header suggests that perhaps there's a better function that vboxvideo_drm.c should be using instead...?
This is probably a duplicate of bug 541050 and reportedly fixed in xf86-video-virtualbox-4.3.26
*** This bug has been marked as a duplicate of bug 541050 ***