Bug 15748 – inconsistent symbols generated by dmd vs ldc
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2016-03-03T09:10:22Z
Last change time
2017-09-28T18:31:58Z
Assigned to
No Owner
Creator
Timothee Cour
Comments
Comment #0 by timothee.cour2 — 2016-03-03T09:10:22Z
test.d:
---
module tests.stacktrace.test2.test;
void test(){}
---
$compiler -oflibfoo.a -lib -g test.d
compiler=dmd:
nm libfoo.a|grep _D5tests10stacktrace5test24testFZv
warning: nm: no name list
00000000000002d4 S _D5tests10stacktrace5test24testFZv
compiler=ldmd2:
0000000000000240 T __D5tests10stacktrace5test24testFZv
several things differ:
double '_' for ldmd2, single for dmd
T (text section) for ldmd2 vs S for dmd
I was actually trying to link a program compiled with dmd with a library compiled with ldc, and ran into:
Undefined symbols for architecture x86_64:
"_D5tests10stacktrace5test212__ModuleInfoZ", referenced from:
_D5tests10stacktrace4test12__ModuleInfoZ in z02.o
"_D5tests10stacktrace5test24testFZv", referenced from:
__Dmain in z02.o
Shouldn't this use case be supported ?
Even if not 100%; would enable use cases involving fast compile times from dmd + fast code (for critical code) from ldc.
Comment #1 by dfj1esp02 — 2016-03-03T15:25:24Z
Single underscore is standard mangling for D symbols, most platforms take it literally, mac traditionally adds extra underscore to all symbols.
Comment #2 by code — 2017-09-28T18:31:58Z
*** This issue has been marked as a duplicate of issue 8207 ***