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
Toolchain update (GCC 13.1.1, binutils 2.40) #226
Conversation
__attribute__(packed) actually implies also align(1): thus the compiler can place the whole structure to arbitrary address. This commit fixes that by adding explicit align to some of these structures (where compiler produced a warning). Following reports explain the issues around packed attribute: * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93910 * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96293
Hi Vojta! Thanks a lot for working on this! Looks good to me overall. I added some small nits. I am not entirely sure I understand the changes to lexicographical_compare. Thanks! |
I believe there's a way for libgcc to be built in multiple versions and GCC to automatically select the appropriate one. Unfortunately other things are eating my time until the end of the month, but after that I'll be free to look into it again. |
Jakub, thanks again! I pushed some more changes, mainly to allow testing with current toolchain (GCC 8) on top of my modifications plus some updates to the FPU configuration. At the moment, I can build everything and boot of integratorcp and Raspberry profiles in QEMU works (on Raspberry it is terminal only in kernel console but I guess that is okay). I have no way to test any of the arm32 builds on real hardware, though. But I admit that it is becoming more and more a mumbo jumbo of "let's try that and see what it does" for me :-). Jirka, that would be great. Thank you. |
Hi Vojta, I will be able to retest on the real hw again after Aug 14. |
I have changed the I have tested (almost) all available emulators from
Others look healthy. |
I successfully tested on a real BeagleBoard xM. Looking good! See my report on helenos-devel for details. |
Cannot reproduce the arm64/virt fail. Seems to work fine for me. arm32/raspberrypi behavior is expected. I can reproduce ia64/ski crash, but so far have no idea what is causing it. I had tested sparc64/niagara before and it worked fine with these changes. riscv64 I have no idea. |
The riscv64 port is still unfinished, thus there's nothing beyond |
Thank you!
Good, thanks!
OK, makes sense. Thanks a lot to everyone for the testing! So I assume that I can merge this and create ticket for |
Sounds good. |
I'd really like to thank you for doing this. I have an additional request, though. Since you've just gone through the process of porting our custom GCC and binutils targets to new version in HelenOS/gcc and Helenos/binutils-gdb, would you be able to document that process in HelenOS wiki? It probably requires some voodoo with git branches and it would be really nice if people didn't have to reinvent the wheel each time we need to do this... |
About the toolchain upgrading. The process is very similar for both GCC and binutils-gdb projects.
Pro-tip :-)
Not sure if I remembered all the big steps but this is at least rough outline. If you believe even this little is useful, I will copy it to the Wiki. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Vojta! I think we are good to merge this. Possible issue shall be addressed lazily.
Sorry about the long radio silence. I had a good long look at the GCC/binutils ports and everything looks good to me on that front. There's a couple things in here that I want to take another look tomorrow, like the packed structs that seem misused to me. A good chunk of commits here can (and should) be applied to master regardless of toolchain. The bug fixes and such. Mind if I cherry-pick and push those while taking a look at the rest? |
Merged most of it with little changes, the notable ones being that I folded together some of the revisions of prior commits, and I removed the offending packed attribute rather than layering another on top (590cb6d). That leaves two explicit casts between enums that I feel like should have a more elegant solution, which I'm trying to figure out. |
Did a bit of cleanup in the toolchain ports, and created new updated branches with binutils 2.41, GDB 13.2 and GCC 13.2. |
BTW: Since GDB supports multi-arch now and most distributions actually distribute a multi-arch build of GDB, would it make sense to remove GDB from our toolchain script and thus save some time and disk space? Or does anyone see a major benefit of keeping our own GDB builds? I vaguely remember discussing this already somewhere, but I am unable to find a written record of it. Thus let's reiterate here. Maybe we can build the GDB optionally. |
Yeah, I don't really see the point of building custom GDB. I've been using packaged multiarch whenever I needed it and haven't seen any issue. Although admittedly my use of GDB is rare and rather surface-level. BTW, since we're talking about debuggers, I'm currently working on using DWARF data for stack traces. I also plan to look at making a rudimentary integrated debugger for the kernel, using the same. Basic stuff like inspecting stack frames and printing out variables after a panic. |
The DWARF support and the debugger plans are great news! Looking forward to it. And to the removal of the fragile map file parsing :) If we only need symbol information, we might also use CTF which is supposed to be simpler to parse than DWARF at run time. |
Well, for just symbol names, we could also use the raw |
Ooooh, I get it now. It's just broken syntax and never affected the compilation. I guess that explains my past inability to get libatomic and libstdc++ to build. 🤦 |
Done. Updated toolchain.sh in master to binutils 2.41, GDB 13.2 and GCC 13.2. Everything seems to build fine on my end, and don't see any issues running emulators so far, so hopefully there's no massive breakage in that extra minor version. I was hoping that after the merge commit above, github will recognize the pull request as merged. Seems it's not that clever, so the hard way it is. Thanks @vhotspur for all the work you did! |
I was unable to build our current toolchain on Fedora 37 so I decided to try to update it to something newer. This PR contains all changes required to make it work with newer GCC and binutils.
I would appreciate if someone would review the changes and test them (I have not yet tested it across all architectures).
A lot of changes in the code are related to better warnings from the compiler: some actually revealed true bugs that I tried to fix, some has to be suppressed.
Note that
cpptest
fails miserably but it seems to me that the same is happening onmaster
branch too. Not sure why, it looks to me like if the vtable gets corrupted somehow.