In a newly installed virtual machine I get this error when compiling the kernel for the x86 architecture:
$ Could not mmap file: vmlinux
$ make: *** [vmlinux] Error 1
It is the first time I see it.
I have increased the size of /proc/sys/kernel/shmmax
to 128MB, but it does not solve the issue. Any ideas?
Thanks! :)
The mmap() function establishes a mapping between a process' address space and a stream file. The address space of the process from the address returned to the caller, for a length of len, is mapped onto a stream file starting at offset off.
What Does mmap() Function? mmap() function or system call will create a mapping in the virtual meory of the current process. The address space consist of multiple pages and each page can be mapped some resource. We can create this mapping for a resources we want to use.
mmap() is used for creating a memory mapping somewhere in virtual memory (somewhere which can be referenced to by the process issuing mmap). Specifying a file descriptor allows the memory to be swapped out to disk.
mmap() returns a pointer into the newly mapped memory. This pointer points into the address space seen by the program and can be used like any other pointer of type void* .
I had the same issue when compiling kernel in virtual box shared folder. Error comes from mmap_file()
function in source file scripts/sortextable.c
.
Moreover, all mmap functions failed with errno EINVAL within shared folder.
I fixed it with copying linux sources into non shared folder like /home/Name/linux and compiled there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With