feat: dynamic cross compiler #14

Merged
jakehamilton merged 4 commits from vlinkz/labs:vlinkz/crosscompiler into main 2025-09-08 20:08:36 +00:00
Owner

This pr adds initial support for creating a cross-compile tool chain for arbitrary architectures. For now only aarch64 and riscv64 are implemented, but simlpy adding another architecture to the list of supported platforms in each package should mostly work with minimal patches.
In order to build native gcc for aarch64, you can run

nix-build --expr '((import ./tidepool).packages.foundation.gcc.versions."13.2.0-stage4".package.extend { platform = { build = "aarch64-linux"; host = "aarch64-linux"; target = "aarch64-linux"; }; }).package'

or

nix-build tidepool -A packages.foundation.gcc.latest.packages.aarch64-linux.aarch64-linux.aarch64-linux

Running this command:

  • Uses foundation to bootstrap i686 gcc
  • Incrementally bootstraps x86_64 gcc from i686
  • Runs through the same incremental process, but this time using x86_64 gcc we previously built to bootstrap aarch64
  • Build the final native aarch64 gcc
This pr adds initial support for creating a cross-compile tool chain for arbitrary architectures. For now only `aarch64` and `riscv64` are implemented, but simlpy adding another architecture to the list of supported platforms in each package should mostly work with minimal patches. In order to build native gcc for aarch64, you can run ``` nix-build --expr '((import ./tidepool).packages.foundation.gcc.versions."13.2.0-stage4".package.extend { platform = { build = "aarch64-linux"; host = "aarch64-linux"; target = "aarch64-linux"; }; }).package' ``` or ``` nix-build tidepool -A packages.foundation.gcc.latest.packages.aarch64-linux.aarch64-linux.aarch64-linux ``` Running this command: - Uses [foundation](https://git.auxolotl.org/auxolotl/foundation) to bootstrap i686 gcc - Incrementally bootstraps x86_64 gcc from i686 - Runs through the same incremental process, but this time using x86_64 gcc we previously built to bootstrap aarch64 - Build the final native aarch64 gcc
vlinkz added 1 commit 2025-09-01 05:50:43 +00:00
vlinkz force-pushed vlinkz/crosscompiler from d673904972 to ffae31da41 2025-09-01 05:51:33 +00:00 Compare
vlinkz force-pushed vlinkz/crosscompiler from ffae31da41 to d0e46369af 2025-09-01 08:08:54 +00:00 Compare
vlinkz added 1 commit 2025-09-01 09:02:52 +00:00
jakehamilton approved these changes 2025-09-02 12:11:03 +00:00
Dismissed
jakehamilton left a comment
Owner

Awesome! I think this can pair extremely well with the recent platforms spec additions in #15. Great work on getting this done so quickly!

Awesome! I think this can pair extremely well with the recent platforms spec additions in #15. Great work on getting this done so quickly!
vlinkz force-pushed vlinkz/crosscompiler from 504e9ded2e to 80b7c3cc27 2025-09-03 05:12:19 +00:00 Compare
vlinkz added 1 commit 2025-09-03 05:17:42 +00:00
vlinkz force-pushed vlinkz/crosscompiler from 9cdcd52e5d to c698d0795a 2025-09-04 00:42:31 +00:00 Compare
jakehamilton approved these changes 2025-09-08 20:06:43 +00:00
jakehamilton added 1 commit 2025-09-08 20:07:01 +00:00
jakehamilton merged commit 4e4b9366a4 into main 2025-09-08 20:08:36 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: auxolotl/labs#14
No description provided.