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
Initial implementation of vc4 cross-compile #72657
Conversation
https://gist.github.com/c9e89ceaadba96f1969bc8eeab8ba532
|
name = "newlib"; | ||
src = fetchFromGitHub { | ||
owner = "itszor"; | ||
repo = "newlib-vc4"; |
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.
Perhaps we should merge the "mainline", "msp430", and "vc4" newlib's into a shared derivation to make this a little easier to maintain (presumably you only want one "newlib" at a time). I hadn't realized how many forks of newlib existed! Not necessary for this PR though.
src = fetchurl { | ||
src = if stdenv.targetPlatform.isVc4 then fetchFromGitHub { | ||
owner = "itszor"; | ||
repo = "gcc-vc4"; |
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.
GCC forks are hard to maintain. Not sure how to handle this though
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 also looks like it's actually GCC6, not GCC8. This would be a good opportunity figure out if we can make it possible to select Compilers when cross compiling. Right now we just do this:
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/cross/default.nix#L54-L62
Adding some option for what GCC version you need would be useful.
/cc @Ericson2314
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.
Yeah let's the diff to be gcc 6 too. We can figure out compiler selection and stuff later. The source replacement isn't fun, but it's the least invasive option. We can bring this stuff up for the platform support RFCs.
i can confirm that building with the gcc6 exprs still works, and the generated |
Awesome! |
This is supported in this GCC fork. [1] It has been packaged in Nixpkgs since 2019. [2] Their change to `config.sub` [3] is similar, but also includes a `vc4` -> `vc4-unknown-elf` shorthand; I don't see any reasons to add any new legacy 1-component short-hands, so I just skipped that part. [1]: https://github.com/itszor/vc4-toolchain [2]: NixOS/nixpkgs#72657 [3]: itszor/gcc-vc4@91278af * config.sub (vc4-*): Recognize. * testsuite/config-sub.data (vc4-unknown-none-elf): New entries.
This is supported in this GCC fork. [1] It has been packaged in Nixpkgs since 2019. [2] Their change to `config.sub` [3] is similar, but also includes a `vc4` -> `vc4-unknown-elf` shorthand; I don't see any reasons to add any new legacy 1-component short-hands, so I just skipped that part. [1]: https://github.com/itszor/vc4-toolchain [2]: NixOS/nixpkgs#72657 [3]: itszor/gcc-vc4@91278af * config.sub (vc4-*): Recognize. * testsuite/config-sub.data (vc4-unknown-none-elf): New entries.
This is supported in this GCC fork. [1] It has been packaged in Nixpkgs since 2019. [2] Their change to `config.sub` [3] is similar, but also includes a `vc4` -> `vc4-unknown-elf` shorthand; I don't see any reasons to add any new legacy 1-component short-hands, so I just skipped that part. [1]: https://github.com/itszor/vc4-toolchain [2]: NixOS/nixpkgs#72657 [3]: itszor/gcc-vc4@91278af * config.sub (vc4-*): Recognize. * testsuite/config-sub.data (vc4-unknown-none-elf): New entries.
This is supported in this GCC fork. [1] It has been packaged in Nixpkgs since 2019. [2] Their change to `config.sub` [3] is similar, but also includes a `vc4` -> `vc4-unknown-elf` shorthand; I don't see any reasons to add any new legacy 1-component short-hands, so I just skipped that part. [1]: https://github.com/itszor/vc4-toolchain [2]: NixOS/nixpkgs#72657 [3]: itszor/gcc-vc4@91278af * config.sub (vc4-*): Recognize. * testsuite/config-sub.data (vc4-unknown-none-elf): New entries.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @