Kernel compilation fails!
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Kernel compilation fails!
Trying to compile a new kernel results in the following:
CC arch/x86/kernel/asm-offsets.s
In file included from include/linux/suspend.h:8:0,
from arch/x86/kernel/asm-offsets.c:12:
include/linux/mm.h:667:2: error: #error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
^
make[3]: *** [arch/x86/kernel/asm-offsets.s] Error 1
I'm running Linux Mint V17.3, 32-bit; uname -r is 4.4.0-116-generic
As far as I know, BITS_PER_LONG is 32-bits, so SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH has to be
< 32-bits (- NR_PAGEFLAGS). In summary, how do I fix this? Is it a kernel configuration problem?
CC arch/x86/kernel/asm-offsets.s
In file included from include/linux/suspend.h:8:0,
from arch/x86/kernel/asm-offsets.c:12:
include/linux/mm.h:667:2: error: #error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
^
make[3]: *** [arch/x86/kernel/asm-offsets.s] Error 1
I'm running Linux Mint V17.3, 32-bit; uname -r is 4.4.0-116-generic
As far as I know, BITS_PER_LONG is 32-bits, so SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH has to be
< 32-bits (- NR_PAGEFLAGS). In summary, how do I fix this? Is it a kernel configuration problem?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
- catweazel
- Level 19
- Posts: 9763
- Joined: Fri Oct 12, 2012 9:44 pm
- Location: Australian Antarctic Territory
Re: Kernel compilation fails!
What files did you download, from where, and what instructions, if any, are you following?stychokiller wrote: ⤴Thu Apr 05, 2018 3:37 amCode: Select all
#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Re: Kernel compilation fails!
First, let me state that I've compiled kernels in the past, just not with Linux Mint. Here's a pertinent
list of what I think is needed to compile a kernel:
installed: linux-source-3.13.0
installed: linux-headers-4.4.0-116
installed: linux-headers-4.4.0-116-generic
Other installed packages... (not an exhaustive list!)
installed: linux-firmware
installed: linux-generic-lts-xenial (???)
installed: linux-headers-generic-lts-xenial
installed: linux-image-4.4.0-116-generic (???)
installed: linux-image-extra-4.4.0-116-generic (???)
installed: linux-image-generic-lts-xenial (???)
installed: linux-kernel-generic (???)
As far as I know, only linux-headers and linux-source are needed to create a kernel. Gcc, binutils, make, etc
are also installed and working, since I can compile my own C-source code files & projects.
list of what I think is needed to compile a kernel:
installed: linux-source-3.13.0
installed: linux-headers-4.4.0-116
installed: linux-headers-4.4.0-116-generic
Other installed packages... (not an exhaustive list!)
installed: linux-firmware
installed: linux-generic-lts-xenial (???)
installed: linux-headers-generic-lts-xenial
installed: linux-image-4.4.0-116-generic (???)
installed: linux-image-extra-4.4.0-116-generic (???)
installed: linux-image-generic-lts-xenial (???)
installed: linux-kernel-generic (???)
As far as I know, only linux-headers and linux-source are needed to create a kernel. Gcc, binutils, make, etc
are also installed and working, since I can compile my own C-source code files & projects.
Re: Kernel compilation fails!
If you're compiling 3.13.0 you need the matching headers for that series.
I don't see 3.13 in the repos
I don't see 3.13 in the repos
Re: Kernel compilation fails!
@WhardRat:
It seems, that you overlooked, that the OP uses LM 17.3, so kernel 3.13 is of course available and is LTS there.
It seems, that you overlooked, that the OP uses LM 17.3, so kernel 3.13 is of course available and is LTS there.
Re: Kernel compilation fails!
Furthermore, synaptic and the software update manager install linux-headers-GoofVersionString in their own /usr/src directory,
which is separate from /usr/src/linux-source-AnotherGoofyVersionString. It appears to me that whatever is wrong is to be
found in the /usr/src/linux-source-AnotherGoofyVersionString/include headers or configuration selections that I've made.
Also:
include/linux/mm.h:667:2: error: #error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
Which tells me this is a memory manager setting that's failing.
It's quite a Wampus hunt to find exactly WHERE SECTIONS_WIDTH, NODES_WIDTH, ZONES_WIDTH & NR_PAGEFLAGS
are #defined, because they're NOT all located in one header file.
which is separate from /usr/src/linux-source-AnotherGoofyVersionString. It appears to me that whatever is wrong is to be
found in the /usr/src/linux-source-AnotherGoofyVersionString/include headers or configuration selections that I've made.
Also:
The key here is:make[2]: Leaving directory `/usr/src/linux-source-3.13.0'
make EXTRAVERSION=-ckt39-jts1 ARCH=i386 prepare
make[2]: Entering directory `/usr/src/linux-source-3.13.0'
scripts/kconfig/conf --silentoldconfig Kconfig
make[2]: Leaving directory `/usr/src/linux-source-3.13.0'
make[2]: Entering directory `/usr/src/linux-source-3.13.0'
make[3]: Nothing to be done for `all'.
make[3]: Nothing to be done for `relocs'.
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC arch/x86/kernel/asm-offsets.s
In file included from include/linux/suspend.h:8:0,
from arch/x86/kernel/asm-offsets.c:12:
include/linux/mm.h:667:2: error: #error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
^
make[3]: *** [arch/x86/kernel/asm-offsets.s] Error 1
make[2]: *** [prepare0] Error 2
make[2]: Leaving directory `/usr/src/linux-source-3.13.0'
include/linux/mm.h:667:2: error: #error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
Which tells me this is a memory manager setting that's failing.
It's quite a Wampus hunt to find exactly WHERE SECTIONS_WIDTH, NODES_WIDTH, ZONES_WIDTH & NR_PAGEFLAGS
are #defined, because they're NOT all located in one header file.
Re: Kernel compilation fails!
apt search linux-headers|grep ^i returns:
i linux-headers-3.13.0-133 - Header files related to Linux kernel versi
i linux-headers-3.19.0-32 - Header files related to Linux kernel versi
i linux-headers-3.19.0-32-generic - Linux kernel headers for version 3.19.0 on
i A linux-headers-4.4.0-109 - Header files related to Linux kernel versi
i A linux-headers-4.4.0-109-generic - Linux kernel headers for version 4.4.0 on
i A linux-headers-4.4.0-111 - Header files related to Linux kernel versi
i A linux-headers-4.4.0-111-generic - Linux kernel headers for version 4.4.0 on
i A linux-headers-4.4.0-112 - Header files related to Linux kernel versi
i A linux-headers-4.4.0-112-generic - Linux kernel headers for version 4.4.0 on
i A linux-headers-4.4.0-116 - Header files related to Linux kernel versi
i A linux-headers-4.4.0-116-generic - Linux kernel headers for version 4.4.0 on
i A linux-headers-4.4.0-119 - Header files related to Linux kernel versi
i A linux-headers-4.4.0-119-generic - Linux kernel headers for version 4.4.0 on
i A linux-headers-generic-lts-xenia - Generic Linux kernel headers
i linux-headers-3.13.0-133 - Header files related to Linux kernel versi
i linux-headers-3.19.0-32 - Header files related to Linux kernel versi
i linux-headers-3.19.0-32-generic - Linux kernel headers for version 3.19.0 on
i A linux-headers-4.4.0-109 - Header files related to Linux kernel versi
i A linux-headers-4.4.0-109-generic - Linux kernel headers for version 4.4.0 on
i A linux-headers-4.4.0-111 - Header files related to Linux kernel versi
i A linux-headers-4.4.0-111-generic - Linux kernel headers for version 4.4.0 on
i A linux-headers-4.4.0-112 - Header files related to Linux kernel versi
i A linux-headers-4.4.0-112-generic - Linux kernel headers for version 4.4.0 on
i A linux-headers-4.4.0-116 - Header files related to Linux kernel versi
i A linux-headers-4.4.0-116-generic - Linux kernel headers for version 4.4.0 on
i A linux-headers-4.4.0-119 - Header files related to Linux kernel versi
i A linux-headers-4.4.0-119-generic - Linux kernel headers for version 4.4.0 on
i A linux-headers-generic-lts-xenia - Generic Linux kernel headers
Re: Kernel compilation fails!
You have the generic - Linux kernel headers for every series except the one you're trying to compile
Try installing it.
Try installing it.
Re: Kernel compilation fails!
I fixed the Problem!
Re-running make menuconfig and changing Processor Type & Features/Memory Model/ from Sparse to Flat
seems to have fixed this failure!
Re-running make menuconfig and changing Processor Type & Features/Memory Model/ from Sparse to Flat
seems to have fixed this failure!