On Wednesday, 3 October 2018 at 20:58:01 UTC, Stanislav Blinov
wrote:
On Wednesday, 3 October 2018 at 20:41:15 UTC, welkam wrote:
I was playing around with dmd`s make file trying to see if I
can compile dmd with different compilers and different
compilation flags. By playing around I found that some dmd
files are compiled with -vtls flag unconditionally and that
ldc do not support this flag. First I dont know what -vtls
flag does so I looked at documentation...
Aren't all variables thread local unless explicitly specified?
No, all *static non-immutable* variables are thread-local by
default, not just "all variables".
What this flag does? Why some files compiled with it and other
dont? Why it is added to all compilation targets
unconditionally?
It does what it says, just prints some diagnostic info. You can
just ignore it, i.e. not use it. As for why it's in the
makefile, I can only guess that someone keeps it there for
diagnostic purposes :)
It was added during the transition to a D codebase to avoid
regressions. These days its more or less useless as it doesn't
fail the build anyhow.
Though LDC and GDC still rely on extern(C++) global variables for
their interface with the frontend (not TLS static).
See also: https://github.com/dlang/dmd/pull/8018