Skip to content

[no merge see #60505] gcc-16 with gdc patches for arm - #62493

Draft
sgn wants to merge 45 commits into
void-linux:masterfrom
sgn:gcc-16
Draft

sgn wants to merge 45 commits into
void-linux:masterfrom
sgn:gcc-16

Conversation

@sgn

@sgn sgn commented Sep 12, 2026

Copy link
Copy Markdown
Member

[skip ci][ci skip]

Based on #60505

This is available for @oreo639 to cherry pick

@sgn sgn changed the title gcc-16 with gdc patches for arm [no merge see #60505] gcc-16 with gdc patches for arm Sep 12, 2026
@oreo639

oreo639 commented Sep 13, 2026

Copy link
Copy Markdown
Member

Thanks for the patch. I am still running into the crashes. (although after looking into it, it might not be related to the gcc 16 time_t patches)

(You need to be compiling on 32-bit musl to encounter the ICE, cross compiling won't encounter the issue.)

The line in question afaict from the gdb disas: https://github.com/dlang/dmd/blob/6b49d066a27f70ea935213f8148e675b7d1af996/druntime/src/core/time.d#L2882-L2883

The crashing is happening in stage1 though. Initially, I thought it was an issue with the time_t patch in gcc 16 since it was occurring in core.time.TickDuration._sharedStaticCtor49 (which is a part of druntime), and I thought gcc was compiling druntime for stage 1 gdc (checking now, I'm pretty sure just uses druntime from, gcc-11 in this case), and the crashing wasn't happening with previous versions of gcc (including gcc 14) for whatever reason.

It does seem like TickDuration got removed from dmd upstream though.

gcc16/ldc output: https://gist.github.com/oreo639/45ccd0fb222524346ffb480c15cd8d8b

EDIT: I doubled checked, clock_getres(CLOCK_MONOTONIC, &ts) in qemu does return {.tv_sec = 0, .tv_nsec = 1} as expected (same when running it natively). We don't have any musl time_t patch there so it probably is caused by that.

EDIT 2: Adding a patch to gcc11 to just use 1_000_000_000 if tv_nsec is zero does allow gcc 16 to get past stage1 although it still fails to link here: https://gitlab.com/gnutools/gcc/-/blob/032c099d7a8703e6611344a4ffaf940939825566/libphobos/libdruntime/core/sys/posix/time.d#L499-518 (presumably the -fversion flag didn't get pulled in somewhere) I will continue tomorrow. (Compiling gcc through qemu is very slow)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants