-
Notifications
You must be signed in to change notification settings - Fork 137
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
Compiling Nanos for RISC-V #1693
Comments
Hi @Yifferpi, |
I have an Ubuntu bionic beaver which is indeed a bit older
and the following versions
I will try to build my own toolchain then. |
So building my own toolchain helped with regard to the illegal operand error. There are now different errors though which I assume are missing dependencies.. The errors are the following:
and
The directory
From what I understand, this means that the target root fs that I downloaded from https://storage.googleapis.com/testmisc/riscv64-target-root.tar.gz (like described in the linked Tutorial) does not contain all necessary files. How can I add them? (some sort of chroot to install them in the directory or use a different root fs overall?) Or is there a newer version specifically for cross-compiling nanos? |
I tried building and running nanos on bionic and did not have a problem aside from the manually built riscv toolchain using a slightly different prefix than the one specified in the makefile. Did you set CC manually by chance to fix the toolchain name? Some of the nanos build objects (such as certain tests) are actually compiled and run on the host architecture rather than the target platform, and I think that might be the source of the errors as they do not use the cross-compiler and must have the host's normal CC. If that's the case, remove the output directory containing the built artifacts, make sure the repo is back to the default state and try running the build like this:
Let me know if that fixes your issue or if you still get those errors. Thanks! |
It worked. Properly deleting the What seems to have made the difference in the end was recompiling the toolchain: according to their instruction, the directory Thank you very much for the concise help. Maybe as a follow up: is there any integration with |
Actually, after playing around with it for some more, there is still a problem persisting: The following compilation error that I mentioned earlier keeps coming up:
I did not realize earlier but it occurs whenever I change the
or set Like mentioned earlier, I wonder whether this is error means there is some missing dependency in the Also, what would be the target for an output suitable for |
Hi @Yifferpi, In regards to your earlier question, we will soon add support to ops for running RISC-V programs locally, but that will still require the user to build on a RISC-V Linux box or cross-compile their program for RISC-V to create a suitable binary for ops to use. I will have a fix for these issues soon, and I am also adding a check for the RISC-V gcc version so that the makefile will error if the gcc RISC-V support is not new enough.
|
Hi @sanderssj I understand that a cross-compiled binary will be needed for ops. I assume the missing part for ops is the boot image? I am looking forward to the ops support, but I'm already in a good place now to try adaptations on the riscv by testing directly with nanos rather than through ops. Thank you very much for the support. |
Since at the moment the RISC-V port runs only under qemu, we don't really need a full blown boot image, because we can pass the kernel file directly to the qemu command line. So currently the missing part for ops only involves starting qemu with the RISC-V-specific command line. |
I don't know if this should belong into another issue: I wanted to run existing tests and issued the following command:
It fails with the following syntax error:
I tried to add the problematic unittest to the |
Currently the |
I'm trying to compile nanos for the RISC-V architecture and there does not seem to be any sort of documentation on it yet. I've tried
and I get the following error message:
I know riscv is not officially/fully supported yet. Also according to #1651 some instructions are not supported yet (not mv though).
I would be happy if you could maybe provide some instructions on how to compile for/to riscv, whatever is working at this point. If it isn't working yet, maybe some pointers to what is yet missing and what would need to be done to compile a working image would be helpful.
Thanks
The text was updated successfully, but these errors were encountered: