On Tuesday, 20 June 2017 at 19:44:46 UTC, kinke wrote:
On Tuesday, 20 June 2017 at 17:52:59 UTC, Dan Walmsley wrote:
How do I link in the run time and gc, etc?
In your case, you firstly need to cross-compile druntime to
your target. This means compiling most files in the src
subdirectory of LDC's druntime [1], excluding obvious ones like
src\test_runner.d, src\core\sys, src\core\stdcpp etc. There are
also a bunch of C and assembly files which need to be
cross-compiled with a matching gcc. You'll need to do this
manually via something along these lines:
cross-gcc -c <.c files and .asm/S files>
ldc2 -mtriple=... -lib -betterC -release -boundscheck=off <.o
files generated above> <list of D source modules>
-of=libdruntime.a
Then try linking your minimal code against that druntime (and
static C libs, as druntime is built on top of the C runtime,
see [2]). Depending on what features you make use of in your
code, you'll need to patch linked-in druntime modules to remove
the OS dependencies and possibly reduce the C runtime
dependencies as well.
[1] https://github.com/ldc-developers/druntime.
[2]
http://forum.dlang.org/thread/[email protected]
when trying to compile I'm getting lots of errors like this one:
C:\dev\repos\druntime\src\gc\impl\manual\gc.d(28): Error: module
config is in file 'gc\config.d' which cannot be read
import path[0] =
C:\Users\danw\AvalonStudio\AppData\Repos\AvalonStudio.Toolchains.LDC.win-x64.4.0.0-build2-alpha\content\bin\..\import\ldc
import path[1] =
C:\Users\danw\AvalonStudio\AppData\Repos\AvalonStudio.Toolchains.LDC.win-x64.4.0.0-build2-alpha\content\bin\..\import
Build Failed
any ideas what could be the cause?