add native x86_64 gcc #12

Open
vlinkz wants to merge 1 commit from vlinkz/labs:vlinkz/cross2native into main
Member

Uses cross compiler to create native x86_64 gcc. Also make cross compilation tools more modular, setting up foundation for compiling to other architectures such as aarch64-linux and riscv64-linux. For example nix build .#packages.x86_64-linux.cross-tool-foundation-gcc-newlib-riscv64-linux will:

  • bootstrap i686 using foundation stuff
  • create an i686 -> x86_64 cross compiler
  • use the cross compiler to build native x86_64 gcc & build tools
  • use x86_64-linux native gcc to create a x86_64 -> riscv64 cross compiler

Unfortunately the largest issue I've ran into is nix evaluation time exploding as I add more packages and the dependency web becomes more complex, for example:

❯ time nix eval .#packages.x86_64-linux.cross-tool-foundation-gcc-newlib-aarch64-linux
«derivation /nix/store/61jnh688i6i562ysx8ql8n89xjip1g4b-gcc-newlib-x86_64-linux--x86_64-linux--aarch64-linux-13.2.0.drv»
nix eval   15.11s user 1.20s system 97% cpu 16.647 total

or worse yet

❯ time nix eval .#packages.x86_64-linux.cross-foundation-glibc-aarch64-linux
«derivation /nix/store/l75i987hmxhghnnmb1mrxpbz3mq1m361-glibc-x86_64-linux--aarch64-linux--aarch64-linux-2.38.drv»
nix eval .#packages.x86_64-linux.cross-foundation-glibc-aarch64-linux  27.22s user 2.23s system 97% cpu 30.063 total

from some basic tracing, it seems like it re-evals every dependency tree for every dependency, but not 100% sure why

Uses cross compiler to create native x86_64 gcc. Also make cross compilation tools more modular, setting up foundation for compiling to other architectures such as aarch64-linux and riscv64-linux. For example `nix build .#packages.x86_64-linux.cross-tool-foundation-gcc-newlib-riscv64-linux` will: - bootstrap i686 using foundation stuff - create an i686 -> x86_64 cross compiler - use the cross compiler to build native x86_64 gcc & build tools - use x86_64-linux native gcc to create a x86_64 -> riscv64 cross compiler Unfortunately the largest issue I've ran into is nix evaluation time exploding as I add more packages and the dependency web becomes more complex, for example: ``` ❯ time nix eval .#packages.x86_64-linux.cross-tool-foundation-gcc-newlib-aarch64-linux «derivation /nix/store/61jnh688i6i562ysx8ql8n89xjip1g4b-gcc-newlib-x86_64-linux--x86_64-linux--aarch64-linux-13.2.0.drv» nix eval 15.11s user 1.20s system 97% cpu 16.647 total ``` or worse yet ``` ❯ time nix eval .#packages.x86_64-linux.cross-foundation-glibc-aarch64-linux «derivation /nix/store/l75i987hmxhghnnmb1mrxpbz3mq1m361-glibc-x86_64-linux--aarch64-linux--aarch64-linux-2.38.drv» nix eval .#packages.x86_64-linux.cross-foundation-glibc-aarch64-linux 27.22s user 2.23s system 97% cpu 30.063 total ``` from some basic tracing, it seems like it re-evals every dependency tree for every dependency, but not 100% sure why
vlinkz added 1 commit 2024-10-29 18:57:33 +00:00
Create native gcc
Some checks failed
buildbot/nix-eval Build done.
f17cba032e
Some checks failed
buildbot/nix-eval Build done.
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u vlinkz/cross2native:vlinkz-vlinkz/cross2native
git checkout vlinkz-vlinkz/cross2native

Merge

Merge the changes and update on Forgejo.
git checkout main
git merge --no-ff vlinkz-vlinkz/cross2native
git checkout main
git merge --ff-only vlinkz-vlinkz/cross2native
git checkout vlinkz-vlinkz/cross2native
git rebase main
git checkout main
git merge --no-ff vlinkz-vlinkz/cross2native
git checkout main
git merge --squash vlinkz-vlinkz/cross2native
git checkout main
git merge --ff-only vlinkz-vlinkz/cross2native
git checkout main
git merge vlinkz-vlinkz/cross2native
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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#12
No description provided.