Skip to content

Initial implementation of vc4 cross-compile#72657

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
cleverca22:vc4
Nov 24, 2019
Merged

Initial implementation of vc4 cross-compile#72657
Ericson2314 merged 1 commit intoNixOS:masterfrom
cleverca22:vc4

Conversation

@cleverca22
Copy link
Copy Markdown
Contributor

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@cleverca22
Copy link
Copy Markdown
Contributor Author

cleverca22 commented Nov 3, 2019

https://gist.github.com/c9e89ceaadba96f1969bc8eeab8ba532
and nix-build -I nixpkgs=../../nixpkgs-vc4/ --argstr linker sram -A helloworld will create a result/hello.bin
if you copy that to bootcode.bin on an SD card, and pop it into a raspberry pi, it will print Hello world! out the serial port at 115200 baud

nix-build -I nixpkgs=../../nixpkgs-vc4/ -A testit will also build a simulator, and run the code inside it

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 3, 2019
@veprbl veprbl added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Nov 3, 2019
Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member

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.

@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 20, 2019
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 20, 2019
@cleverca22
Copy link
Copy Markdown
Contributor Author

i can confirm that building with the gcc6 exprs still works, and the generated bootcode.bin works on all 4 of my rpi's (models 1, 1, 2 and 3)

@Ericson2314 Ericson2314 changed the title initial implementation of vc4 cross-compile Initial implementation of vc4 cross-compile Nov 24, 2019
@Ericson2314 Ericson2314 merged commit 814f910 into NixOS:master Nov 24, 2019
@Ericson2314
Copy link
Copy Markdown
Member

Awesome!

@cleverca22 cleverca22 deleted the vc4 branch November 27, 2019 23:38
@siraben siraben mentioned this pull request Jun 16, 2021
11 tasks
Ericson2314 added a commit to Ericson2314/gnu-config that referenced this pull request Oct 28, 2023
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.
Ericson2314 pushed a commit to Ericson2314/gnu-config that referenced this pull request Oct 28, 2023
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.
Ericson2314 pushed a commit to Ericson2314/gnu-config that referenced this pull request Oct 28, 2023
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.
Ericson2314 pushed a commit to Ericson2314/gnu-config that referenced this pull request Oct 28, 2023
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.
adivinho pushed a commit to Percona-Lab/savannah_config that referenced this pull request Mar 11, 2025
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 entry.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants