Skip to content

Toolchain: GCC 15 #25920

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Toolchain: GCC 15 #25920

wants to merge 9 commits into from

Conversation

Hendiadyoin1
Copy link
Contributor

@Hendiadyoin1 Hendiadyoin1 commented May 5, 2025

@ADKaster I think you know abit about key-functions and the like, any clue why the LibGUI change is needed?

Missing things:

  • AARCH64 build is broken, something with Pointer auth, no clue about that so @BertalanD, you are deeper into toolchains, please help
  • riscv build was inconsistent on my end spholz got it to work, but for me it didn't work

@@ -16,18 +16,16 @@ void* memcpy(void* dest_ptr, void const* src_ptr, size_t n)
// FIXME: Support starting at an unaligned address.
if (!(dest & 0x3) && !(src & 0x3) && n >= 12) {
size_t size_ts = n / sizeof(size_t);
n -= size_ts * sizeof(size_t);
asm volatile(
"rep movsq\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No cld?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And why did you move the n -= size_ts * sizeof(size_t);?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the cld/iff we can make assumptions about DF

as for the code move, if I understand the + clobber correctly it means, in-out so it would clobber size_ts, make it 0, making the subtraction not work as intedet

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, you are right about the inline assembly overriding size_ts.

The cc clobber should be unnecessary: https://stackoverflow.com/questions/75198561/how-to-let-gcc-know-that-the-direction-flag-df-in-the-eflags-register-has-change#answer-75203424

The x86-64 psABI only requires DF to be clear on function entry/exit, so I think it can technically be set when control flow reaches the inline asm.
Every example online seems to do a cld before instructions respecting the flag, but they never restore it to the previous state. But shouldn't that be wrong? Or does GCC expect DF to be zero after inline asm statements?

I could swear it didn't work without the cld, but it seems to work with your code.

@@ -11,6 +11,8 @@

namespace GUI {

JsonArrayModel::~JsonArrayModel() = default;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at this, the destructor was not the key function before, data(ModelIndex const&, ModelRole) was. So if the destructor is not emitted into libgui-serenity.so with gcc 15, that's a boog in the compiler and/or linker.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That being said. the patch as-is is fine and benign and doesn't actually change any behavior -- explicitly defaulting a destructor at the declaration site has no effect if the thing is actually virtual.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the symbol not exist at all, or is it just hidden?

@Hendiadyoin1 Hendiadyoin1 force-pushed the gcc-15 branch 3 times, most recently from 64a384c to 0c2a413 Compare May 7, 2025 20:12
@Hendiadyoin1 Hendiadyoin1 marked this pull request as ready for review May 15, 2025 20:38
@Hendiadyoin1 Hendiadyoin1 requested a review from timschumi as a code owner May 15, 2025 20:38
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label May 15, 2025
@Hendiadyoin1 Hendiadyoin1 force-pushed the gcc-15 branch 2 times, most recently from 06ac87a to 113afe2 Compare May 21, 2025 16:58
GCC 15 seems to raise a false positive here in some cases
Co-Authored-By: Sönke Holz <[email protected]>
Co-Authored-By: Daniel Bertalan <[email protected]>

F: Clobbers
GCC 15.1.0 has a code-gen bug which causes some odd bit fiddling
otherwise, so lets use the multiplication compilers usually emit instead
Seems like GCC 15 now also has this warning
Otherwise newer GCC versions will complain about uninitialized memory
accesses
Not sure why this is needed but otherwise SystemMonitor can't find the
symbol...
Copy link
Member

@spholz spholz May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small commit message nit: You're no longer changing the asm clobbers, only other kinds of asm operands. Also, the last line contains a stray "F: Clobbers."
And you should remove the "LibC+" part from the category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 pr-needs-review PR needs review from a maintainer or community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants