About supporting EMScripten

Ferhat Kurtulmuş aferust at gmail.com
Fri Dec 18 12:32:53 UTC 2020


On Thursday, 17 December 2020 at 11:34:32 UTC, Ferhat Kurtulmuş 
wrote:
> On Thursday, 17 December 2020 at 08:04:01 UTC, Ferhat Kurtulmuş 
> wrote:
>> On Wednesday, 16 December 2020 at 22:41:55 UTC, kinke wrote:
>>> On Wednesday, 16 December 2020 at 20:07:44 UTC, Ferhat

I cannot compile a test program on Windows using Sebastiaan's 
druntime. Do I need to compile the ldc from scratch? I am using a 
precompiled one. Why do I get `cannot find source code for 
runtime library file 'object.d'`? ldc2.conf has already the 
required include paths?

TLDR: Failed to invoke the compiler ldc2 to determine the build 
platform: binary

import std.stdio;

void main() {
     import core.stdc.stdio;
     printf("exit");
}

dub.json includes:
"buildRequirements": ["allowWarnings"],
"dflags": ["-mtriple=wasm32-unknown-unknown-wasm"]

etc/ldc2.conf includes

"^wasm(32|64)-":
{
     switches = [
         "-defaultlib=c,druntime-ldc,phobos2-ldc",
         "-link-internally",
     ];
     post-switches = [
      "-ID:/dlang/ldc/runtime/druntime/src>",
      "-ID:/dlang/ldc/runtime/phobos>",
     ],
     lib-dirs = 
["D:/dlang/ldc/runtime/ldc-build-runtime.tmp/lib>","D:/dlang/wasi-sdk-11.0/share/wasi-sysroot/lib/wasm32-wasi/>"];
};

set PATH=%PATH%;D:\dlang\ldc2-1.20.0-windows-multilib\bin
dub --arch=wasm32-unknown-unknown-wasm --build-mode=allAtOnce 
--compiler=ldc2

and the output is

Failed to invoke the compiler ldc2 to determine the build 
platform: binary    
D:\dlang\ldc2-1.20.0-windows-multilib\bin\ldc2.exe
version   1.20.0 (DMD v2.090.1, LLVM 9.0.1)
config    D:\dlang\ldc2-1.20.0-windows-multilib\etc\ldc2.conf 
(wasm32-unknown-unknown-wasm)
predefs   LDC all D_Version2 assert D_ModuleInfo D_Exceptions 
D_TypeInfo WebAssembly LittleEndian LDC_LLVM_900
parse     dub_platform_probe_162f26df_07c5_464d_99bd_3df41eb112d9
importall dub_platform_probe
Error: cannot find source code for runtime library file 'object.d'
        ldc2 might not be correctly installed.
        Please check your ldc2.conf configuration file.
        Installation instructions can be found at 
http://wiki.dlang.org/LDC.
import path[0] = D:\dlang\ldc\runtime\druntime\src>
import path[1] = D:\dlang\ldc\runtime\phobos>





More information about the digitalmars-d-ldc mailing list