Bug 23660 – DMD doesn't emit ABI-compatible extern(C++) thunks

Status
NEW
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-01-29T21:43:01Z
Last change time
2024-12-13T19:26:58Z
Keywords
backend, C++
Assigned to
No Owner
Creator
Iain Buclaw
See also
https://issues.dlang.org/show_bug.cgi?id=15579, https://github.com/dlang/dmd/pull/14824
Moved to GitHub: dmd#18150 →

Comments

Comment #0 by ibuclaw — 2023-01-29T21:43:01Z
Test added by issue 15579 has been reverted. c++ -m64 -c runnable_cxx/extra-files/cppb.cpp -o test_results/runnable_cxx/cppb.cpp.o -std=c++11 dmd -m64 -Irunnable_cxx -preview=in -checkaction=C -fPIC -L-lstdc++ -L--no-demangle -odtest_results/runnable_cxx -oftest_results/runnable_cxx/cppa_0 runnable_cxx/cppa.d test_results/runnable_cxx/cppb.cpp.o Result in linker error: --- test_results/runnable_cxx/cppb.cpp.o:cppb.cpp:_ZTV7Derived: error: relocation refers to global symbol "_ZThn16_N7Derived7MethodDEv", which is defined in a discarded section section group signature: "_ZN7Derived7MethodDEv" prevailing definition is from test_results/runnable_cxx/cppa_0.o collect2: error: ld returned 1 exit status Error: linker exited with status 1 --- GDC and LDC do not have the same problem, they emit extern(C++) thunks with C++ mangling.
Comment #1 by robert.schadek — 2024-12-13T19:26:58Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18150 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB