Update libxenon to use GCC16 - #82
Conversation
Credits to claude, i would have never guessed that this optimization would have caused it
|
Not including issues GCC decided to turn into warning-as-error, does other homebrew, Linux etc build (and more importantly, work) properly with this toolchain?
It'd be good to comment where and why this happens for future people to stumble upon, like how it being relocated is commented. |
|
@InvoxiPlayGames do we have any good example homebrew that we know compiles against the latest version of libxenon? I may need to make some updates to libxenon/drivers/newlib, though. It looks like there may be a new dependency on
I'll have a look in to that and ping you when i've got an update. Re: Linux, i was able to compile and boot 6.17 and was also able to boot an existing ArchISO from my flash drive. No issues there. |
GCC 16 optimizes away integer overflow/underflow (yes... technically undefined behaviour) but this breaks things like EDRAM init
|
So i've finally got snes9x-gx working under the new compiler (There are still some UI problems... GCC 9.2 had those as well), and the cube example also works, but i've run into an issue outside of my wheelhouse- The new GCC uses
I'll need to do some more research but would like an expert opinion... proper fix would be nice but i'm not familiar with what the implications would be and it's quite late. I'll be able to revisit later this week. |
|
Personally, I'd rather the simplest option that isn't a hack. Given most of the reasoning for switching to |
The experts have spoken. The new GCC uses .init_array instead of .ctors for C++ static constructors, meaning no C++ constructors are getting called. This change reverts GCC behaviour so existing C++ homebrew does not need any changes.
|
@InvoxiPlayGames pushed a change for |
|
If you can confirm XeLL stage1 works fine like this then I'll merge. |
Yep, stage 1 works fine. I was able to flash an updxell.bin and boot with no issues. |

This PR makes the following changes to update the compiler in libxenon to GCC 16.2.0:
getentropy-Wno-error=int-conversion -Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types--disable-initfini-arrayto ensure gcc uses.ctorsrather than.init_arrayfor C++ constructors, so existing homebrew works as-is-fwrapvfor libxenon to prevent GCC from optimizing away integer overflow (which broke the edram init code)Note: Free60Project/libext2fs#3 is a prereq to this since the ext2 library does need a few tweaks to build clean with GCC16