Bug 21977 – importC: Global declarations are thread-local by default
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-05-25T21:29:32Z
Last change time
2021-06-24T08:17:21Z
Keywords
ImportC, pull, wrong-code
Assigned to
No Owner
Creator
Iain Buclaw
Comments
Comment #0 by ibuclaw — 2021-05-25T21:29:32Z
In D all globals and static variables are thread-local unless explicitly otherwise. In C, it's the opposite.
---
int signgam;
char *program_invocation_name;
---
$ objdump -t issue.o
issue.o: file format elf64-x86-64
SYMBOL TABLE:
0000000000000000 g .tbss 0000000000000004 signgam
0000000000000008 g .tbss 0000000000000008 program_invocation_name
Comment #1 by dlang-bot — 2021-06-23T22:08:46Z
@ibuclaw created dlang/dmd pull request #12743 "fix Issue 21977 - importC: Global declarations are thread-local by default" fixing this issue:
- fix Issue 21977 - importC: Global declarations are thread-local by default
https://github.com/dlang/dmd/pull/12743
Comment #2 by dlang-bot — 2021-06-24T08:17:21Z
dlang/dmd pull request #12743 "fix Issue 21977 - importC: Global declarations are thread-local by default" was merged into master:
- 7820f5340470ba09c2b0bccecf54e3a02ea84bff by Iain Buclaw:
fix Issue 21977 - importC: Global declarations are thread-local by default
https://github.com/dlang/dmd/pull/12743