Skip to content
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

how can i relate releases with riscv-gcc version #1552

Closed
1010186930 opened this issue Sep 18, 2024 · 13 comments
Closed

how can i relate releases with riscv-gcc version #1552

1010186930 opened this issue Sep 18, 2024 · 13 comments

Comments

@1010186930
Copy link

1010186930 commented Sep 18, 2024

i want to build riscv32-unknown-elf-gcc 11.0 in Windows with source code, but i have no idea which release should i download. Is there any relation between release date with gcc version?

@TommyMurphyTM1234
Copy link
Collaborator

I think that might be tricky as you would have to identify all of the relevant repositories and branches/tags to collate all the correct sources for all of the components for a GCC 11.0 toolchain build. Especially since older versions of riscv-gnu-toolchain used forked repos for sub-components like GCC, Binutils, Newlib etc. whereas more recent ones have used sources from the upstream projects. I don't think that relevant information is readily available anywhere so it might take some detective work and may involve a lot of trial and error.

What about using a binary build like @ilg-ul's xPack GNU RISC-V Embedded GCC?

Alternatively there may be a CI build of a GCC 11.0 toolchain in the Releases section but again you might have to do some digging:

@ilg-ul
Copy link

ilg-ul commented Sep 18, 2024

You can download any past GCC release directly from GNU (or any mirror):

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Sep 18, 2024

You can download any past GCC release directly from GNU (or any mirror):

Yes, but I suspect that back in the GCC 11.0 days a lot of the RISC-V support development/enhancement was being done here (in the riscv-gnu-toolchain repo) and in related (riscv-gcc etc.) forked repos - so downloading a build from the GCC FTP server may not give the "best" RISC-V support?

@ilg-ul
Copy link

ilg-ul commented Sep 18, 2024

downloading a build from the GCC FTP server may not give the "best" RISC-V support?

agree, support for RISC-V was upstreamed gradually, and old GCC releases may not include all the desired features.

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Sep 18, 2024

GCC 11 (11.1 - there's no 11.0 listed here but I think that GCC doesn't do releases with a '0' minor version?) was released April 27th 2021:

This is the first riscv-gnu-toolchain CI build that is based on GCC 11.1[.0] in case that's of any use (it also includes a tarball of the sources used to create it):

I didn't check further but there are probably subsequent CI builds that are also based on 11.x.

Why do you want to build/use such an old toolchain? A more recent one will have much better, more complete, and more stable RISC-V support.

@1010186930
Copy link
Author

GCC 11 (11.1 - there's no 11.0 listed here but I think that GCC doesn't do releases with a '0' minor version?) was released April 27th 2021:

This is the first riscv-gnu-toolchain CI build that is based on GCC 11.1[.0] in case that's of any use (it also includes a tarball of the sources used to create it):

I didn't check further but there are probably subsequent CI builds that are also based on 11.x.

Why do you want to build/use such an old toolchain? A more recent one will have much better, more complete, and more stable RISC-V support.

My development environment is that J-Link(embedded system tool in Windows) loads riscv bin to my device(compiled in Linux with riscv32-unknown-elf-gcc, the version of which is 11.1.0), and i need to use J-Link tool as a gdb-server and a gdb client to debug my device.Therefore, i need a riscv toolchain which 11.1.0 in Windows, and i find no executable program, which is exactly the same version. Do i make a correct method to solve this promble? Maybe i am wrong

@1010186930
Copy link
Author

1010186930 commented Sep 19, 2024

You can download any past GCC release directly from GNU (or any mirror):

Does it mean that riscv32-unknown-elf toolchain(may arm cc as well?) is built with GNU toolchain only if complie it with correct parameter? I am also confused that how can i compile the source code to get the same toolchain as Linux in Windows

@TommyMurphyTM1234
Copy link
Collaborator

My development environment is that J-Link(embedded system tool in Windows) loads riscv bin to my device(compiled in Linux with riscv32-unknown-elf-gcc, the version of which is 11.1.0), and i need to use J-Link tool as a gdb-server and a gdb client to debug my device.Therefore, i need a riscv toolchain which 11.1.0 in Windows, and i find no executable program, which is exactly the same version.

Why do you specifically need GCC 11 here?
If you have a binary that was compiled with GCC 11 that needs to be loaded and debugged then you should be able to do that a later version of the tools/GDB.
And if you have the program in question in source form then surely you can just compile it with a later version of the toolchain?

In any case, trying to use such an old version of the toolchain when RISC-V support was much less complete/stable is probably not a great idea. riscv-gnu-toolchain is currently based on GCC 13.2 and pending an update to GCC 14.2 and there have been many improvements in RISC-V support since GCC 11:

I don't understand why there is a dependency on GCC 11 specifically here?

Therefore, i need a riscv toolchain which 11.1.0 in Windows,

The CI builds on this repo are only for Linux.
You can probably use @ilg-ul's xPack tools as I suggested above if you adjust for the specifics of that toolchan - e.g. the fact that that toolchain uses a different name prefix and default arch/abi to the riscv-gnu-toolchain toolchain:

Do i make a correct method to solve this promble? Maybe i am wrong

I don't understand what you mean here - please clarify.

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Sep 19, 2024

Does it mean that riscv32-unknown-elf toolchain is built with GNU toolchain only if complie it with correct parameter? I am confused that how

Sorry, I don't understand what exactly you're trying to ask here. Maybe you can clarify.

I would not try to use a GCC 11 binary build from the upstream GCC FTP server for RISC-V development because at the time that GCC 11 was released much of the RISC-V development/enhancment was done here in this and related repos and not upstream.
So if you take the toolchain from that FTP server then it almost certainly will not have the "best" or most complete RISC-V support available at that time.

But, as I've said several times already, I wouldn't even use GCC 11 at all for RISC-V development because it's so out of date. You would be much better advised to use a more recent build of the toolchain - at least 13.2.0 from this repo or maybe even 14.2.0 built from upstream sources.

@1010186930
Copy link
Author

Why do you specifically need GCC 11 here?

i thought it should be used the same version of toolchain to debug and it seems that i am wrong

@1010186930
Copy link
Author

You can probably use @ilg-ul's xPack tools as I suggested above if you adjust for the specifics of that toolchan - e.g. the fact that that toolchain uses a different name prefix and default arch/abi to the riscv-gnu-toolchain toolchain:

i will try this. Thank you

@1010186930
Copy link
Author

I don't understand what you mean here - please clarify.

i've never tried to build GNU toolchain in Windows with the source code before. Therefore, my method to solve this problem may be wrong.

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Sep 19, 2024

i thought it should be used the same version of toolchain to debug and it seems that i am wrong

riscv-gnu-toolchain is currently based on GCC 13.2.0 and GDB 15.1 (and other components such as Binutils, Newlib etc.):

GDB 15.1 can be used to debug any ELF executable program - including one that was originally compiled using GCC 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants