-
Notifications
You must be signed in to change notification settings - Fork 16
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
Updating past GCC 6.3? #103
Comments
great you try to do it -is a jump from 6.3 to 12 not a bit too much/far? so many changes over the years |
I'm trying to go straight to 12 and seeing what happens. If it doesn't work, I can try porting to an earlier version first. I checked with friends, and all the major deprecations between 6.x and 12.x seem to not affect the ia16 target's code, so there was no reason to try.
I did not, but it seems |
I've fixed the above-mentioned C++ error (it was the poly_int64 migration), and fixed almost all errors in non-target and target code. I'll look at it again some time later, probably later today or tomorrow. |
It compiles! But it doesn't compile much of anything. But it's a start. The problem seems to be that:
I managed to compile the C examples for the Wonderful toolchain I develop with |
Reverting 6a33438 's override of ia16_can_eliminate seems to fix compilation on @tkchia , would you like to take this from here? I'm not sure what to do from here (work on it more, move on to another one of my bucket list projects, etc.) without further coordination. |
Hello @asiekierka, I am kind of occupied with working on #104 — but I hope to get around to what you are doing. For now, are you able to start running the regression tests ( Thank you! |
I cannot run The GCC testsuite will need work - I did not merge reenigne's big testsuite patch commit as a lot of it was focused on fixes for platforms which do not assume a 32-bit int - but fixes for the same issue were done independently and in a different way by GCC's developers sometime between 6.3.0 and 12.1.0, leading to a very conflict-heavy situation. I'll need to brush up on a lot of GCC theory to figure out what the correct patches should be for anything. Right now, it fails at building libgcc. :D Thank you, and I hope we can get gcc-ia16 up to date soon! EDIT: I fixed compiling with |
Hello @asiekierka, The |
Given that However, running
NOTE: This is with ia16_can_eliminate no-oped out. Otherwise it crashes on any program in It's just a "barely got it to compile" test, so it's not looking great. Many of these failures are because of an ICE in libgcc. Many others are because of the same few issues (new unimplemented insns, etc). Some tests need to be re-adapted for ia16 (see original post for details). |
There is a tool called git-imerge which can do merges and rebases "commit by commit" to handle complex conflicts. It is however pretty slow and for large histories doing all the manual merges can take quite a while. Also you mentioned something about histories, if the GCC 6 history for this project and GCC 12 history haven't been made with the same tool you're probably in for some interesting times. |
there a least thousands of commit between :) but this presentation of imerge is really interesting: https://www.youtube.com/watch?v=FMZ2_-Ny_zc at ~18:05 he is talking about how each merge step can be tested in between if the merge result runs fine could take some time but maybe its a good solution funny that there is no git intergrated feature like that |
I've already done the "commit by commit" process by hand. I skipped two commits because:
|
imerge might also allow you to find the problematic commits on GCC side so you can see exactly what broke ours. Though that might require an ability (and willingess) to run the whole GCC build and test process on every commit. I'm not sure that's implemented yet and and suspect it would take an insanely long time. |
Nono. I merged the ia16 port commits to the GCC 12 tree, not the GCC 12 commits to the ia16 tree. The latter would be nearly impossible, involve literally many thousands of commits, and two repos with incompatible root commits and history trees. So no, this approach won't help. I firmly believe it's better to figure it out this way - and try to keep more up to speed on GCC updates in the future :) |
Hello @asiekierka,
Urgh. The GNU toolchain generally knows how to output debug information (e.g. DWARF) in ELF files. The problem is that I have not quite figured out how to propagate this debug information to the output executables (which are normally not ELF), and it is probably not good to erroneously pretend that there is debug output. But it looks like we will need to undo this tricky knot somehow or other. 😐
That will be kind of hard. Many of the test cases expect a toolchain that can go the full nine yards and output an executable program. This can only be done if there is an actual C library, in this case Newlib. I guess it is a good idea for now to look further into the Thank you! |
Yes, it's emitting ICEs. However, I'm not sure when I'll be able to look into them particularly deeply - I'll try to do so as soon as possible. In the meantime, the Binutils 2.34 -> 2.38 update I made seems to be more reliable (due to fewer breaking changes) and actually removes one of the hacks made by the ia16 (segelf) patches, so if you want to, you can look into that too. PS. I managed to undo the debug output requirement. So that's not a worry for now. |
Two ICE patches made so far:
Results look a little more promising (I'm running the tests multithreaded):
Just to keep notes, the next issue is:
on |
I fixed the above issue, as well as two ICEs that manifested in the test suite. Further comments available in commits, but here's a summary:
Unfortunately, there are a fair few execution errors, and I'm not yet sure how to debug these - and I'd like to spend some time working on the library part of my WonderSwan toolchain too, so I'm not sure how much time I'll be able to devote to the GCC 12 update... Either way, libgcc compiles fully now, and Newlib gets pretty far before hitting a different ICE. I'd say it would be good to think about deciding when a GCC 12 branch could be adopted in place of the GCC 6.3 branch for new development. Thank you! |
Given the lack of time and expertise to work on a larger update, I decided to try something with a smaller surface first:
Due to the smaller change surface, this one naturally fares much better, only ICEing at the
No further updates for now, unfortunately. |
Any updates on this? In particular, if it were possible to use GCC-IA16 with LIBGCCJIT, it would open up a lot of possibilities, such as the Rust GCC backend, and I am fairly sure that requires a newer version of GCC. |
Is there a reason you need a 16-bit Rust? DJGPP (32-bit GCC) is available for 12.1. I documented the process for building on Fedora 36 here (andrewwutw/build-djgpp#45). |
I have gotten Rust to target a 386 before, but yeah, I recently acquired an IBM 5155, which has an 8088, and developing for it is something I’m interested in these days. |
I'm curious if there's a specific reason as to which the repository is frozen at GCC 6.3.0. I can see that the Git history would take substantial effort to integrate, but is there a reason to stick with 6.3.0 - or 6.x in general?
(FWIW, the same question applies to binutils, which I wouldn't mind tackling next.)
To find out how much effort it would take to port gcc-ia16 patches to GCC 12.1.x, I've decided to track the
releases/gcc-12
branch on another repo and port over the changes:https://github.com/WonderfulToolchain/gcc-ia16/tree/gcc-ia16-12
https://github.com/asiekierka/build-ia16/tree/toolchain-update-2022
I got stuck on a C++ error in calls.cc, and I have to get some sleep so I can't debug it further today... There's some caveats, too:
Either way, I think the repo represents a good start/first look at the feasibility of upgrading the toolchain.
The text was updated successfully, but these errors were encountered: