June 11, 2019
https://issues.dlang.org/show_bug.cgi?id=15523

Nicholas Wilson <iamthewilsonator@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iamthewilsonator@hotmail.co
                   |                            |m

--- Comment #10 from Nicholas Wilson <iamthewilsonator@hotmail.com> ---
extern(C++):

// Standard:
extern int iiiiiiiii; // thread_local

void foo()
{
    iiiiiiiii = 42;
}
Generates with LDC:

@iiiiiiiii = external thread_local global i32, align 4

DMD:

extrn   iiiiiiiii

_Z3foov:
    ...
    lea RDI,iiiiiiiii@TLSGD[RIP]

There are no mangling issues.

Can this issue be closed?

--
June 11, 2019
https://issues.dlang.org/show_bug.cgi?id=15523

--- Comment #11 from Manu <turkeyman@gmail.com> ---
This isn't a mangling issue, it's an ABI issue.
It's not clear if extern C++ and D TLS vars can link to each other.

--
June 11, 2019
https://issues.dlang.org/show_bug.cgi?id=15523

--- Comment #12 from Nicholas Wilson <iamthewilsonator@hotmail.com> ---
I meant there were also no mangling issues.

The examples above are codegen tests (albeit textual), I'm saying the problem is like already fixed. If you can verify that the the ticket can be closed.

--
June 11, 2019
https://issues.dlang.org/show_bug.cgi?id=15523

--- Comment #13 from Manu <turkeyman@gmail.com> ---
I'm not sure this problem has ever been attempted.
Are there unit tests that show they link and read/write from each other?

--
June 11, 2019
https://issues.dlang.org/show_bug.cgi?id=15523

--- Comment #14 from Nicholas Wilson <iamthewilsonator@hotmail.com> ---
(I realised I typo'd likely as like in the above post)

There are no unit tests that I know of, but they shouldn't be hard to write. I'll do one up tomorrow and submit it to the test suite if you don't beat me to it.

--
June 11, 2019
https://issues.dlang.org/show_bug.cgi?id=15523

--- Comment #15 from Manu <turkeyman@gmail.com> ---
test.cpp:
---------

thread_local int x = 100;
extern thread_local int y;

void test()
{
  x += y;
  y += x;
}



test.d:
-------

import std.stdio;

extern(C++) extern int x;
extern(C++) int y = 200;

extern(C++) void test();

int main()
{
  test();

  assert(x == 300);
  assert(y == 500);

  x += y;
  y += x;

  assert(x == 800);
  assert(y == 1300);

  return 0;
}



-------------------------

1>test.d(6): error : variable `test.y` Internal Compiler Error: C++ static non-__gshared non-extern variables not supported

So, that's the first issue...

But then, it's possible that GDC/LDC will TLS the same as GCC/Clang, but I wonder if DMD will be compatible with any of the others, and Windows...?

--
March 26, 2021
https://issues.dlang.org/show_bug.cgi?id=15523

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #16 from Dlang Bot <dlang-bot@dlang.rocks> ---
@thewilsonator created dlang/dmd pull request #12309 "Fix issue 15523-
extern(C++) support TLS (C++ 'thread_local') linkage" fixing this issue:

- Fix issue 15523- extern(C++) support TLS (C++ 'thread_local') linkage

https://github.com/dlang/dmd/pull/12309

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=15523

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
1 2
Next ›   Last »