On 24 March 2016 at 10:52, Vincent R via D.gnu <d.gnu@puremagic.com> wrote:

I would like to generate gdc compiler on msys2/mingw-w64 platform.
The build system on msys2 uses archlinux build architecture and the build file is here:

To generate it I followed the following steps:

1) Install https://msys2.github.io/

$ update-core
$ pacman -Su
$ git clone https://github.com/vrichomme/MINGW-packages.git
$ cd MINGW-packages
$ git fetch origin
$ git checkout -b newfastrelease origin/newfastrelease
$ cd mingw-w64-gcc
$ export MINGW_INSTALLS=mingw64
$ makepkg-mingw -sLf

But of course I get an error because the platform is not supported:

How readily does Mingw support pthreads? What may be needed is simply a new package for mingw-specific system functions (ie: core.sys.mingw.pthread).  In the meantime, you should be able to get around by passing --enable-threads=win32 when configuring teh gcc build.

But how is defined this value ? Is it based on uname function ?
Can I trace the value of version when compiling the file ?

What versions that are internally defined depend on the target triplet passed when configuring the build.  This directly affects what target headers are included, which contain macros we call when initializing the compiler.

It has been requested even in DMD to have some command-line option to print all turned on version conditions set by the compiler.  Itself is a very trivial addition.  In the absence of that though, in a debugger you can set a breakpoint on VersionCondition::addPredefinedGlobalIdent.