Cross-compile from x86_64 linux to RISC-V linux #1880
-
|
Hello, I am new using Alire and I am trying to make a university project with Ada but I have this problem. My goal is to create a binary that can run on a MilkV Duo-S board that was a linux buildroot distro installed, in one of its two RISC-V 64 bits IMAFDC cores (C906 processor) by compiling the code on an x86_64 computer (linux ubuntu virtual machine run from Windows). The program is simple, using an ads file and a C file to take advantage from the language interfacing that Ada allows, I declare a constant in the ads file that is exported to a C file that prints it in the terminal. The source files: Main file written in C called Ada specification file called The attempt: Run alr init:
Add the following lines to prueba7.gpr: Modify the following line in prueba7.gpr: Change Change the toolchain to compile in RISC-V:
Run alr run, receive the following error (I am ignoring the style and dependencies warnings): I was able to run this program when I compile it using the native toolchain, so the source code should be fine. Any help is greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Hello, You question seems not related for Alire itself, so I suggest to discuss it in another place. Ada Forum or Reddit, for example. Initial setup to start to use of Ada is a bit tricky, you can take a look at my experiment, see |
Beta Was this translation helpful? Give feedback.
The
gnat_riscv64_elftoolchain is for baremetal only. There are no pre-compiled GNAT cross compiler for RISC-V Linux that I know of.You can check if there is one in the RISC-V Linux distrib your are using. Typically Ubuntu/debian provide GNAT compilers.