Am Sun, 23 Dec 2018 01:21:22 +0000 schrieb MINGW-USER: > It seems version (Windows) is not defined into the compiler gdc.exe gdc > (GCC) 9.0.0 20181221 (experimental) > built with msys2/mingw-w64 on Windows 10. > > The trouble appears while building libdruntime > > EXAMPLE: libphobos\libdruntime\core\stdc\time.d error: undefined > identifier 'time_t' > error: undefined identifier 'tm' > > Manually add > > version (GNU) { > alias c_long time_t; alias c_long clock_t; > } > > into time.d then it compiles but it seems weird. > > The trouble is that there are many other similar errors with > core\stdc\stddef.d, stdlib.d, stdint.d, etc ... > > Help needed.
That's an interesting coincidence, I just set up a Windows 10 VM + MSYS2 for MinGW development a day ago. How exactly did you build GCC? I tried to build in the mingw64 environment using the same configure flags as in the mingw-w64-gcc package [1] and without any GCC patches. I had to fix some build errors in filename.c, did you get these as well? Additionally the built toolchain is not properly relocatable: Installing into / works, but if I use DESTDIR=/somewhere/else to install, the new gcc doesn't find the headers in /mingw64/x86_64... anymore. So if you know any better way to build GCC in the MSYS2 environment, please let me know :-) And regarding the specific problem you mentioned: As gdc is untested on the mingw backend, the patches for mingw which set version(Windows) have not been applied to the GCC sources. You have to apply this patch manually: https://github.com/D-Programming-GDC/GDC/blob/ 958363de2ba09656de340d13ca56f80f8ba10805/patches/targetdm-untested.patch However, phobos probably won't build right now either way. [1] ../gcc-9-20181216/configure --enable-languages=lto,d,c++ --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 -- host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system- header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --with-arch=x86-64 --with-tune=generic --enable-shared --enable-static -- enable-libatomic --enable-threads=posix --enable-graphite --disable- libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check -- enable-lto --enable-libgomp --disable-multilib --disable-rpath --disable- win32-registry --disable-nls --disable-werror --disable-symvers --with- libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 -- with-mpc=/mingw64 --with-isl=/mingw64 --with-gnu-as --with-gnu-ld -- disable-bootstrap --enable-libphobos -- Johannes