-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support building across architectures #5
base: main
Are you sure you want to change the base?
Conversation
Currently I can build a binary built on ppc64le targeting x86_64 and run it in qemu-system-x86_64. Needs some clean-up. Next up: aarch64. riscv64 doesn't have a prebuilt package from https://go.dev/dl/ like other major architectures, so we may need to build from source like Ron suggested at the last sync meeting. |
Add an ARCH variable and replace the hardcoded "amd64" with a string derived from `uname -m` in order to build non-x86 initramfs images. Signed-off-by: David Hendricks <[email protected]>
Replace crossgcc-i386 with crossgcc-${ARCH} based on the architecture passed in from Makefile.inc. Signed-off-by: David Hendricks <[email protected]>
Make VPD support optional in order to enable builds for more mainboard targets. VPD should still be added for production usage, this is mostly intended to help get new targets up and running. Signed-off-by: David Hendricks <[email protected]>
This will be used when cross-compiling Linux kernels. Signed-off-by: David Hendricks <[email protected]>
Linux and `uname` don't always agree on what to call a given architecture. This adds a LINUX_ARCH variable that will be used for kernel config names and for cross-compilation. Signed-off-by: David Hendricks <[email protected]>
Accomodate different paths to the kernel image for various architectures. Signed-off-by: David Hendricks <[email protected]>
Make the build and qemu invocation more cross-platform friendly. Signed-off-by: David Hendricks <[email protected]>
GOARCH needs to reflect the target architecture. GOROOT needs to point at GOROOT that is compatible with the host. Signed-off-by: David Hendricks <[email protected]>
22110d4
to
8a6a92c
Compare
Leverage coreboot's buildgcc to build a suitable Linux toolchain if needed. Signed-off-by: David Hendricks <[email protected]>
This is needed due to mismatched machine names used by `uname` and qemu-system-*. Signed-off-by: David Hendricks <[email protected]>
This will be useful later when we add targets for other architectures. Signed-off-by: David Hendricks <[email protected]>
GCC 8.3.0 seems to have compilation issues, and we may as well update to the latest coreboot release anyway. Signed-off-by: David Hendricks <[email protected]>
This attempts to make a "splitconfig" type of kernel configuration for x86_64 so that we only include options that are intentionally enabled. Other options will be set to default values by `make olddefconfig`. Tested by building from scratch and booting to u-root shell using qemu-system-x86_64. Signed-off-by: David Hendricks <[email protected]>
Decompressing GCC takes a significant amount of time. Gzip can be decompressed using multiple threads (buildgcc will use `pigz` if available), so this just trades decompression speed and download time (download should only occur once anyway). Signed-off-by: David Hendricks <[email protected]>
This gives us a target to build. It does not work yet. Signed-off-by: David Hendricks <[email protected]>
This gives us a target to build. It does not work yet. Note: This should use the power9 qemu target for coreboot once it's merged: https://review.coreboot.org/c/coreboot/+/57084 Signed-off-by: David Hendricks <[email protected]>
There are still some loose ends here, but I think we can start reviewing it and perhaps merge a few commits. x86_64 fully builds and boots into u-root, other configs need some work which I hope will be relatively easy now that the scaffolding is in place. With this patchset applied, one should be able to build using the following commands:
For reference, the coreboot docs provide recipes for getting qemu targets running: |
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.
Should we update the readme file as well?
Do you want to get this to finish line? Now that we have it supporting AMD platform (Onyx) as well.
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.
This is very old, so I will take it over and try to get it to work.
Support building cross target platforms
This supplants #3