www.digitalmars.com         C & C++   DMDScript  

D.gnu - Creating a Windows build, need assistance

I'm currently trying to build GDC for Windows via MSYS2, so that 
we can finally have all three compilers on every major operating 
system. However, I've been running into a few roadblocks when 
doing so, and I'm unsure about how to proceed.

Currently I can successfully build GDC 11, but the resulting 
compiler has at least one frontend bug that causes it to crash 
when building some GCC-14 modules (specifically cpuid.d, I 
believe). Because of that issue, I'm trying to see if GDC 9 would 
be a better choice to bootstrap, since GCC seems to recommend it 
on one of their pages.

The problem I have now is that some of the gcc builtins are 
undefined in GDC 9, resulting in errors like this:
```
../../../../gcc-9.2.0/libphobos/libdruntime/core/thread.d:2430:13: error:
undefined identifier '__builtin_unwind_init'
  2430 |             __builtin_unwind_init();
       |             ^
../../../../gcc-9.2.0/libphobos/libdruntime/core/thread.d:3220:16: error:
undefined identifier '__builtin_frame_address'
  3220 |         return __builtin_frame_address(0);
       |                ^
...
```

The only forum post I can find of this sort of error was closed 
because it looked like a duplicate bug, but I'm unsure if that is 
actually the case.

So currently I'm a bit stuck, with no idea how to solve this 
frontend issue myself, and no idea which version of GDC would 
give me a greater chance of success. I'd be grateful if someone 
with more experience could help me solve these issues or provide 
any extra advice, so that we can get GDC working on Windows (with 
the better debug information that it provides compared to the 
other compilers).
Nov 27