Bug 22974 – importC: D name mangling applied to extern variable inside function
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-02T21:00:09Z
Last change time
2022-05-05T21:04:13Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
duser
Comments
Comment #0 by duser — 2022-04-02T21:00:09Z
// a.c
int x;
// b.c
int main()
{
extern int x;
x = 1;
return 0;
}
compile: dmd a.c b.c
/usr/bin/ld: a.o: in function `main':
b.c:(.text.main[main]+0x3): undefined reference to `_D1b4mainUY1xi'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
Comment #1 by dlang-bot — 2022-04-05T07:11:01Z
@WalterBright created dlang/dmd pull request #13950 "fix Issue 22974 - importC: D name mangling applied to extern variable…" fixing this issue:
- fix Issue 22974 - importC: D name mangling applied to extern variable inside function
https://github.com/dlang/dmd/pull/13950
Comment #2 by dlang-bot — 2022-04-07T03:04:37Z
dlang/dmd pull request #13950 "fix Issue 22974 - importC: D name mangling applied to extern variable…" was merged into master:
- 0e8c57429c091355715e3b4d57a585c9266322f8 by Walter Bright:
fix Issue 22974 - importC: D name mangling applied to extern variable inside function
https://github.com/dlang/dmd/pull/13950
Comment #3 by dlang-bot — 2022-05-01T09:18:36Z
dlang/dmd pull request #14045 "[stable] Move fix for issue 22974 from glue layer to frontend" was merged into stable:
- 0beb05ad08586f4a4b88eb9b78f7918ed12ad878 by Martin Kinkelin:
Move fix for issue 22974 from glue layer to frontend
See #13950.
https://github.com/dlang/dmd/pull/14045
Comment #4 by dlang-bot — 2022-05-05T21:04:13Z
dlang/dmd pull request #14064 "merge stable" was merged into master:
- a1a9ad8e1f9e524306f37f36d09388eddb166159 by Martin Kinkelin:
Move fix for issue 22974 from glue layer to frontend
See #13950.
https://github.com/dlang/dmd/pull/14064