Trouble getting KF6 working on LibreOffice Flatpak

Hi all, I’m having trouble with getting KF6 (& Qt6) working with LibreOffice on Flathub.

A constant error I’m seeing before the whole build fails on x86_64 is:

/usr/lib/gcc/x86_64-unknown-linux-gnu/13.2.0/../../../../include/c++/13.2.0/cstdlib:79:15: fatal error: 'stdlib.h' file not found

However, aarch64 seems to fail with a different error (not sure what lines I should paste here).

You can find my PR here: Use KDE SDK, Runtime and KF6, update to 24.2.2.1 by sungsphinx · Pull Request #285 · flathub/org.libreoffice.LibreOffice · GitHub, and the last failed build here: Flathub builds.

Any help would be highly appreciated as I am a bit of a newbie when it comes to this sort of stuff, some talk from me and others was happening in #flatpak:kde.org on Matrix if you want to pop in there.