www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - new -vtls flag does nothing?

reply Brian Palmer <d brian.codekitchen.net> writes:
I decided to try out the new shared stuff in 2.030 on OS X, so I ran it against
a module I've written using the -vtls flag. Now I *know* there are globals in
this module, so I was surprised to see no output.

To make doubly sure, I ran 2.030 against the example module given at
http://www.digitalmars.com/d/2.0/migrate-to-shared.html with the -vtls flag. No
output there either.

int x;

void main() {
    static int y;
}

Is the vtls flag non-functional? Is this an OS X specific issue?
Jun 16 2009
parent reply Walter Bright <newshound1 digitalmars.com> writes:
Brian Palmer wrote:
 I decided to try out the new shared stuff in 2.030 on OS X, so I ran
 it against a module I've written using the -vtls flag. Now I *know*
 there are globals in this module, so I was surprised to see no
 output.
 
 To make doubly sure, I ran 2.030 against the example module given at
 http://www.digitalmars.com/d/2.0/migrate-to-shared.html with the
 -vtls flag. No output there either.
 
 int x;
 
 void main() { static int y; }
 
 Is the vtls flag non-functional? Is this an OS X specific issue?

I get: dmd test -vtls test.d(2): x is thread local test.d(5): y is thread local
Jun 16 2009
parent reply Brian Palmer <d brian.codekitchen.net> writes:
Walter Bright Wrote:

 I get:
 
 dmd test -vtls
 test.d(2): x is thread local
 test.d(5): y is thread local

Very odd... I still get:
 cat test.d

int x; void main() { static int y; }
 dmd test -vtls

(successfully compiles with no output.) I'm kind of at a loss as far as what else to tell you, though. I noticed also that the help text when you run dmd without parameters makes no mention of the new -vtls flag. Version is "Digital Mars D Compiler v2.030", again I'm on OS X Leopard.
Jun 16 2009
parent Walter Bright <newshound1 digitalmars.com> writes:
Brian Palmer wrote:
 I'm on OS X Leopard.

Oh, that's the problem. TLS isn't implemented on OSX.
Jun 16 2009