Hello,
I'm trying to cross-compile with ldc for a x86_64-windows-msvc
target. I followed https://wiki.dlang.org/Cross-compiling_with_LDC (using prebuilt LDC package for C runtime) and it worked just fine. But I'd like to get rid of the ldc2.conf
file and have the whole work being done in command line.
The problem is that I can't find a replacement for the 'lib-dir' configuration entry in command line interface. Replacing it with -L=-L$LDC_ROOT/lib-win64/ldc2-1.36.0-windows-x64/ -L=-L$LDC_ROOT/lib-win64/ldc2-1.36.0-windows-x64/mingw
doesn't work :
>> ldc2 -mtriple=x86_64-windows -L=-L$LDC_LIB/ -L=-L$LDC_LIB/mingw foo.d -defaultlib=phobos2-ldc,druntime-ldc
lld-link: error: undefined symbol: __chkstk
>>> referenced by druntime-ldc.lib(dmain2.obj):(_d_run_main)
>>> referenced by druntime-ldc.lib(dmain2.obj):(_d_run_main)
>>> referenced by druntime-ldc.lib(dmain2.obj):(_d_run_main2)
>>> referenced 5 more times
Error: linking with LLD failed
it seems that it has to do with this snippet in druntime, but I don't understand what changed between configuration file and cli.
Adding '-L=/alternatename:__chkstk=___chkstk_ms' doesn't solve the problem.
Do you have any idea of how to make it work without ldc2.conf configuration file ?