-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding NOTE about building 32-bit kernel #3027
Conversation
If you are attempting to compile a 32-bit kernel on the 32-bit distribution of Raspberry Pi OS you should be aware that while the userland in this distribution is 32-bit, the kernel is a 64-bit kernel. You should therefore follow the instructions for cross-compiling the kernel.
That doesn't quite match my comment on #3019:
In other words, building the 64-bit kernel on the 32-bit OS is more of a cross-compilation exercise because it requires the installation of the cross-compiler (which is what |
@aallan Re your changes in commit [0e99ba4]. Sorry, I hate to be awkward, but I still find the wording problematic. To build a 32-bit kernel on 32-bit Raspberry Pi OS, it says to "set
Is that correct / sufficient? Or does ARCH=arm need to be added also to the make command that builds the kernel itself? Further, mentioning the possibility that " |
@@ -12,6 +12,8 @@ The instructions below are divided into native builds and cross-compilation; cho | |||
|
|||
=== Building the Kernel Locally | |||
|
|||
IMPORTANT: Building the 64-bit kernel on the 32-bit distribution of Raspberry Pi OS is a cross-compilation exercise because it requires the installation of the cross-compiler (`gcc-aarch64-linux-gnu`). Building the 32-bit kernel on the 32-bit distribution of Raspberry Pi OS — which has a 32-bit userland, and 64-bit kernel — you should set `ARCH=arm`, although it's likely that this may already be set as `arm_64bit=0` will have been set. Instructions for <<cross-compiling-the-kernel,cross-compiling the kernel>> can be found later on this page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the 32-bit distribution of Raspberry Pi OS — which has a 32-bit userland, and 64-bit kernel" - that's only the case on Pi 4B, Pi 400, CM4 and CM4S ? https://www.raspberrypi.com/documentation/computers/config_txt.html#arm_64bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, unless the user has explicitly set arm_64bit=1
on BCM2710-based device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lurch Can you nip in and fix that up?
Suggestions for revised wording are welcome. |
OK, will give it a go (but not immediately, maybe tomorrow). |
In the meantime, could someone (@pelwell?) answer my previous question, namely: To build a 32-bit kernel on 32-bit Raspberry Pi OS, it says to "set ARCH=arm", but doesn't explain how / where you do that. I assume it has to be given at least as an extra argument when making the default configuration, namely as:
Is that correct / sufficient? Or does ARCH=arm need to be added (also) to the make command that builds the kernel itself? |
You can pass it to each |
So do both "make" calls need ARCH to be set, ie the setting of various values in .config by "make bcm2711_defconfig" is not sufficient? |
So yes, both/all of them. |
If you are attempting to compile a 32-bit kernel on the 32-bit distribution of Raspberry Pi OS you should be aware that while the userland in this distribution is 32-bit, the kernel is a 64-bit kernel. You should therefore follow the instructions for cross-compiling the kernel.
Closes #3019 when merged.