Calypso
Calypso copied to clipboard
error: The module 'ℂcpp.std.type_info' is already defined in libcalypso-ldc-shared.dylib
BUG:D20180106T154634
@Syniurge @klickverbot @ MartinNowak (since this seem to touch on druntime shared library initialization issues)
on OSX:
main.d:
// simplified from https://wiki.dlang.org/Calypso
modmap (C++) "<vector>";
import (C++) std.vector;
void main(){
import core.stdc.stdio : printf;
printf("begin\n");
vector!int v;
printf("v.size = %d\n", cast(int)v.size);
printf("end\n");
}
# build calypso (with some modifications to allow build to succeed; cf other bugs i reported)
$calypso_D/bin/ldc2 -of=$exe -cpp-args=-I$HOME/homebrew/include/ -cpp-verbosediags -v -defaultlib=phobos2-ldc-shared,druntime-ldc-shared -cpp-args=-std=c++11 -cpp-args=-stdlib=libc++ -cpp-args=-v -cpp-args=-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -cpp-args=-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include -cpp-args=-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -cpp-args=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include -cpp-args=-Wno-expansion-to-defined -L-L$calypso_D/lib -L-lcalypso-ldc-shared main.d
$exe
Fatal Error while loading 'main': The module 'ℂcpp.std.type_info' is already defined in '$calypso_D/lib/libcalypso-ldc-shared.dylib'.
environment:
binary $calypso_D/bin/ldc2
version 1.3.0git-e5342cc-dirty (DMD v2.073.2, LLVM 3.9.1)
config $calypso_D/bin/ldc2.conf (x86_64-apple-darwin17.2.0)
predefs LDC all D_Version2 LDC_DCompute assert X86_64 D_InlineAsm_X86_64 D_HardFloat LittleEndian D_LP64 D_PIC OSX darwin Posix D_ObjectiveC LDC_LLVM_309
- Other note: I had to instrument _d_dso_registry to avoid
assert(handle !in _handleToDSO);
failing insetDSOForHandle
, see https://github.com/Syniurge/Calypso/issues/64 for details
workaround: see https://github.com/Syniurge/Calypso/issues/60#issuecomment-358059644
Does this still happen for you? I can't reproduce the error anymore, but don't really know why it works now (maybe the later LDC version?).