Conversation
This was referenced Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enhances the ELKS build system to take advantage of make's parallel build capability, which drastically reduces the time required to build the cross-compiler, C library, kernel, and applications. This capability is also added to the GitHub CI system, which is run on every PR/commit.
Time to build ia16-elf-gcc cross-compiler from scratch: 30+ minutes -> 11 minutes.
Time to build full ELKS C library, kernel and applications: 3-4 minutes -> 45 seconds (16-core MacBook Pro).
A number of ideas and code for this PR were previously submitted by @asiekierka in #2480 and @djohanse in #2695. Thank you both very much for your submissions, sorry it's taken so long. Also, thanks to @hexadec1mal for providing information and a possible fix for the sometimes-seen compiler-generated.h problem during the kernel build.
When running
. env.shto setup the ELKS environment, eithersysctl(for macOS) ornproc(for Linux/CI) is used to obtain the number of cores available, which is then passed as an argument to make usingmake -jusing the MAKEFLAGS environment variable. If parallel make building is not desired, edit env.sh and setMAKEFLAGS=.There may be further speedups possible in the kernel build by optimizing the elf2elks/elftoolchain and elks-compress builds, as well as possibly speeding up buildext.sh, build.sh, buildimages.sh and image creation, which are still built sequentially.
This enhancement has been tested on macOS and on GitHub CI. While I believe all the bases are now covered with regards to potential problems in building the C library, kernel and applications, there may still be race conditions that come up. Now that I understand how parallel make actually works, hopefully any problems can be quickly fixed.
Now that I see the huge benefits in building ELKS using all cores, I realize this should have been done a long time ago. Thanks again to @asiekierka and @djohanse for pushing for this as well as providing code.