www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - About supporting EMScripten

reply Hipreme <msnmancini hotmail.com> writes:
Are there any plans for supporting EMScripten? I still think that 
supporting Web and Android are things that would give a 
substantial revival to D.
And I'm really not talking about betterC, if I were to program 
without D, there should be no reason to even start with D.

Vladimir Panteleev(aka CyberShadow) and Sebastien Alaiwan(aka Seb 
I think) are the big players on this project

If you don't want to plan to support it, would someone give me 
some advice on how would I be able to do this myself? I'm still 
on very early stage of doing those porting things but I'm pretty 
lost, I would like to being able to help on wherever I can, if 
there any advices on how to start porting things, I would be 
grateful.

Do I need to learn about LLVM, LDC, EMScripten and WebAssembly? 
Which things would be target for accomplishing almost full D 
support onto those things?
I'm on Dlang discord as Hipreme, if someone would welcome me at 
helping me those things, please, send me a DM, I'll be sure to 
document the entire process.
Aug 04 2020
parent reply kinke <kinke gmx.net> writes:
On Tuesday, 4 August 2020 at 21:52:46 UTC, Hipreme wrote:
 Are there any plans for supporting EMScripten?
Nope, not really. AFAIU, Emscripten is superseded by regular WebAssembly + WASI, and druntime + Phobos ports are almost ready, see https://github.com/ldc-developers/ldc/pull/3345.
Aug 05 2020
parent reply Hipreme <msnmancini hotmail.com> writes:
On Wednesday, 5 August 2020 at 10:51:42 UTC, kinke wrote:
 On Tuesday, 4 August 2020 at 21:52:46 UTC, Hipreme wrote:
 Are there any plans for supporting EMScripten?
Nope, not really. AFAIU, Emscripten is superseded by regular WebAssembly + WASI, and druntime + Phobos ports are almost ready, see https://github.com/ldc-developers/ldc/pull/3345.
My level of knowledge wasn't enough to understand what is really happeneing in this PR Is there some way for me to get started using this WASM without BetterC and using SDL? Is there someway I can help in this project?
Aug 05 2020
parent reply Sebastiaan Koppe <mail skoppe.eu> writes:
On Wednesday, 5 August 2020 at 20:34:07 UTC, Hipreme wrote:
 Is there some way for me to get started using this WASM without 
 BetterC
You will need to compile it yourself and configure ldc.conf to point to the built libraries. This is all very beta so likely you will hit some dark corners. I wish it was further along and had some good docs, but it is what it is.
 and using SDL?
Emscripten has a port of SDL, but this is just druntime. If you want to do audio and graphics I can only show you the port of a js13k game I did. Play it live at https://skoppe.github.io/spasm/examples/underrun/ source at https://github.com/skoppe/spasm/tree/master/examples/underrun At this point I can't help you much, but once things are more finished I hope you can try out some things.
Aug 05 2020
parent reply Hipreme <msnmancini hotmail.com> writes:
On Wednesday, 5 August 2020 at 21:40:47 UTC, Sebastiaan Koppe 
wrote:
 On Wednesday, 5 August 2020 at 20:34:07 UTC, Hipreme wrote:
 Is there some way for me to get started using this WASM 
 without BetterC
You will need to compile it yourself and configure ldc.conf to point to the built libraries. This is all very beta so likely you will hit some dark corners. I wish it was further along and had some good docs, but it is what it is.
 and using SDL?
Emscripten has a port of SDL, but this is just druntime. If you want to do audio and graphics I can only show you the port of a js13k game I did. Play it live at https://skoppe.github.io/spasm/examples/underrun/ source at https://github.com/skoppe/spasm/tree/master/examples/underrun At this point I can't help you much, but once things are more finished I hope you can try out some things.
If I have some way to test and help, I would be happy already. Is there some built libraries already? Or I'll need to run ldc-build-runtime myself? If I can get past this point, I'll be documenting it anyway, I like to document everything I do So, is it possible to integrate the EMScripten SDL port with what you're doing?
Aug 05 2020
parent reply Sebastiaan Koppe <mail skoppe.eu> writes:
On Wednesday, 5 August 2020 at 21:46:49 UTC, Hipreme wrote:
 If I have some way to test and help, I would be happy already.
 Is there some built libraries already? Or I'll need to run 
 ldc-build-runtime myself?
You need to run it yourself. Very manual at the moment. Here are some very rough instructions. 1) Clone ldc and checkout my PR mentioned above. 2) Download and extract https://github.com/CraneStation/wasi-sdk/releases/download/wasi-sdk-8/wasi- dk-8.0-linux.tar.gz somewhere. 3) export WASI_SDK_PREFIX=<path/to/wasi-sdk-8.0> 4) go into the ldc's runtime folder and run `ldc-build-runtime --ninja "--dFlags=-mtriple=wasm32-wasi" --ldcSrcDir=../ CMAKE_TOOLCHAIN_FILE="$WASI_SDK_PREFIX/share/cmake/wasi-sdk.cmake" WASI_SDK_PREFIX=$WASI_SDK_PREFIX BUILD_SHARED_LIBS=OFF` (you may need to build ldc-build-runtime first). That should get you a wasm build of druntime and phobos in `runtime/ldc-build-runtime.tmp/lib`. 5) Add this to ldc2.conf and fix the folders for your install ``` "^wasm(32|64)-": { switches = [ "-defaultlib=c,druntime-ldc,phobos2-ldc", "-link-internally", ]; post-switches = [ "-I<path/to/runtime/druntime/src>", "-I<path/to/runtime/phobos>", ], lib-dirs = ["<path/to/runtime/ldc-build-runtime.tmp/lib>","<path/to/wasi-sdk-8.0/share/wasi-sysroot/lib/wasm32-wasi/>"]; }; ``` 6) create a dub project somewhere, add `buildRequirements "allowWarnings"` to the dub.sdl app.d ``` void main() { import core.stdc.stdio; printf("exit"); } ``` 7) compile that with `dub --arch=wasm32-unknown-unknown-wasm --build-mode=allAtOnce` (from memory). 8) run with wasmtime or wasmer To get it to run in the browser you need a WASI loader, as it will depend on several WASI runtime functions. If in doubt consult the `azure-pipelines/posix.yml` and search for wasm (it will have everything until the dub project).
 So, is it possible to integrate the EMScripten SDL port with 
 what you're doing?
I rather not, but I guess it is possible.
Aug 06 2020
next sibling parent reply cbleser <udefranette gmail.com> writes:
On Thursday, 6 August 2020 at 10:15:54 UTC, Sebastiaan Koppe 
wrote:
I tried to install the
 On Wednesday, 5 August 2020 at 21:46:49 UTC, Hipreme wrote:
 If I have some way to test and help, I would be happy already.
 Is there some built libraries already? Or I'll need to run 
 ldc-build-runtime myself?
You need to run it yourself. Very manual at the moment. Here are some very rough instructions. 1) Clone ldc and checkout my PR mentioned above. 2) Download and extract https://github.com/CraneStation/wasi-sdk/releases/download/wasi-sdk-8/wasi- dk-8.0-linux.tar.gz somewhere. 3) export WASI_SDK_PREFIX=<path/to/wasi-sdk-8.0> 4) go into the ldc's runtime folder and run `ldc-build-runtime --ninja "--dFlags=-mtriple=wasm32-wasi" --ldcSrcDir=../ CMAKE_TOOLCHAIN_FILE="$WASI_SDK_PREFIX/share/cmake/wasi-sdk.cmake" WASI_SDK_PREFIX=$WASI_SDK_PREFIX BUILD_SHARED_LIBS=OFF` (you may need to build ldc-build-runtime first). That should get you a wasm build of druntime and phobos in `runtime/ldc-build-runtime.tmp/lib`. 5) Add this to ldc2.conf and fix the folders for your install ``` "^wasm(32|64)-": { switches = [ "-defaultlib=c,druntime-ldc,phobos2-ldc", "-link-internally", ]; post-switches = [ "-I<path/to/runtime/druntime/src>", "-I<path/to/runtime/phobos>", ], lib-dirs = ["<path/to/runtime/ldc-build-runtime.tmp/lib>","<path/to/wasi-sdk-8.0/share/wasi-sysroot/lib/wasm32-wasi/>"]; }; ``` 6) create a dub project somewhere, add `buildRequirements "allowWarnings"` to the dub.sdl app.d ``` void main() { import core.stdc.stdio; printf("exit"); } ``` 7) compile that with `dub --arch=wasm32-unknown-unknown-wasm --build-mode=allAtOnce` (from memory). 8) run with wasmtime or wasmer To get it to run in the browser you need a WASI loader, as it will depend on several WASI runtime functions. If in doubt consult the `azure-pipelines/posix.yml` and search for wasm (it will have everything until the dub project).
 So, is it possible to integrate the EMScripten SDL port with 
 what you're doing?
I rather not, but I guess it is possible.
Thank you for the instruction. I tried to compile wasm-druntime. But I run into some problems inside the I following error. CMake Error at CMakeLists.txt:227 (list): list sub-command REMOVE_ITEM requires two or more arguments. I have made a repo on https://github.com/tagion/wasm_druntime.git Which should run the build like this: ``` make subdate make all ``` I am not sure of I have the correct branch?
Aug 29 2020
parent reply Sebastiaan Koppe <mail skoppe.eu> writes:
On Saturday, 29 August 2020 at 12:33:08 UTC, cbleser wrote:
 Thank you for the instruction.
 I tried to compile wasm-druntime. But I run into some problems 
 inside the I following error.

 CMake Error at CMakeLists.txt:227 (list):
   list sub-command REMOVE_ITEM requires two or more arguments.

 I have made a repo on
 https://github.com/tagion/wasm_druntime.git
 Which should run the build like this:
 ```
 make subdate
 make all
 ```
 I am not sure of I have the correct branch?
It seems you don't have the right version of ldc/druntime/phobos. Please checkout https://github.com/skoppe/ldc/commit/828926064c52eba905d9bbbf9d4d57f64a2cd267
Aug 31 2020
parent reply cbleser <udefranette gmail.com> writes:
On Monday, 31 August 2020 at 08:31:11 UTC, Sebastiaan Koppe wrote:
 On Saturday, 29 August 2020 at 12:33:08 UTC, cbleser wrote:
 Thank you for the instruction.
 I tried to compile wasm-druntime. But I run into some problems 
 inside the I following error.

 CMake Error at CMakeLists.txt:227 (list):
   list sub-command REMOVE_ITEM requires two or more arguments.

 I have made a repo on
 https://github.com/tagion/wasm_druntime.git
 Which should run the build like this:
 ```
 make subdate
 make all
 ```
 I am not sure of I have the correct branch?
It seems you don't have the right version of ldc/druntime/phobos. Please checkout https://github.com/skoppe/ldc/commit/828926064c52eba905d9bbbf9d4d57f64a2cd267
Hi Sebastiaan. Thank you for you input. But still run into another problem. I corrected the branch now it compiles but it does not link. The test can be found here. https://github.com/tagion/wasm_druntime.git I have tried ldc-build-runtime with both ninja and make nut the result is the same. Used ldc-build-runtime cd /tmp/wasm_druntime/ldc/runtime; ldc-build-runtime --dFlags=-mtriple=wasm32-wasi --buildDir=/tmp/wasm_druntime/ldc-build-runtime.tmp --ldcSrcDir=../ CMAKE_TOOLCHAIN_FILE=/tmp/wasm_druntime/wasi-sdk-8.0/share/cmake/wasi-sdk.cmake WASI_SDK_PREFIX=/tmp/wasm_druntime/wasi-sdk-8.0 BUILD_SHARED_LIBS=OFF --- cut --- Error: unrecognized file extension obj make[2]: *** [CMakeFiles/druntime-ldc.dir/build.make:1292: lib/libdruntime-ldc.a] Error 1 make[2]: Leaving directory '/tmp/wasm_druntime/ldc-build-runtime.tmp' make[1]: *** [CMakeFiles/Makefile2:265: CMakeFiles/druntime-ldc.dir/all] Error 2 make[1]: Leaving directory '/tmp/wasm_druntime/ldc-build-runtime.tmp' make: *** [Makefile:130: all] Error 2 --- cut -- The compiler I use is. ldc2 --version LDC - the LLVM D compiler (1.20.1): based on DMD v2.090.1 and LLVM 10.0.0 built with LDC - the LLVM D compiler (1.20.1) Default target: x86_64-pc-linux-gnu Host CPU: skylake http://dlang.org - http://wiki.dlang.org/LDC Registered Targets: aarch64 - AArch64 (little endian) aarch64_32 - AArch64 (little endian ILP32) aarch64_be - AArch64 (big endian) amdgcn - AMD GCN GPUs arm - ARM arm64 - ARM64 (little endian) arm64_32 - ARM64 (little endian ILP32) armeb - ARM (big endian) avr - Atmel AVR Microcontroller bpf - BPF (host endian) bpfeb - BPF (big endian) bpfel - BPF (little endian) hexagon - Hexagon lanai - Lanai mips - MIPS (32-bit big endian) mips64 - MIPS (64-bit big endian) mips64el - MIPS (64-bit little endian) mipsel - MIPS (32-bit little endian) msp430 - MSP430 [experimental] nvptx - NVIDIA PTX 32-bit nvptx64 - NVIDIA PTX 64-bit ppc32 - PowerPC 32 ppc64 - PowerPC 64 ppc64le - PowerPC 64 LE r600 - AMD GPUs HD2XXX-HD6XXX riscv32 - 32-bit RISC-V riscv64 - 64-bit RISC-V sparc - Sparc sparcel - Sparc LE sparcv9 - Sparc V9 systemz - SystemZ thumb - Thumb thumbeb - Thumb (big endian) wasm32 - WebAssembly 32-bit wasm64 - WebAssembly 64-bit x86 - 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64 xcore - XCore I checked the .obj file and they are the correct format file CMakeFiles/druntime-ldc.dir/druntime/src/core/stdc/errno.c.obj CMakeFiles/druntime-ldc.dir/druntime/src/core/stdc/errno.c.obj: WebAssembly (wasm) binary module version 0x1 (MVP) And wasm2was list looks correct. Maybe I have the wrong compiler or can I use another linker?
Sep 01 2020
next sibling parent reply Sebastiaan Koppe <mail skoppe.eu> writes:
On Tuesday, 1 September 2020 at 13:18:15 UTC, cbleser wrote:
 On Monday, 31 August 2020 at 08:31:11 UTC, Sebastiaan Koppe 
 wrote:
 It seems you don't have the right version of 
 ldc/druntime/phobos. Please checkout 
 https://github.com/skoppe/ldc/commit/828926064c52eba905d9bbbf9d4d57f64a2cd267
Hi Sebastiaan. Thank you for you input. But still run into another problem. I corrected the branch now it compiles but it does not link. [...] --- cut --- Error: unrecognized file extension obj make[2]: *** [CMakeFiles/druntime-ldc.dir/build.make:1292: lib/libdruntime-ldc.a] Error 1 make[2]: Leaving directory '/tmp/wasm_druntime/ldc-build-runtime.tmp' make[1]: *** [CMakeFiles/Makefile2:265: CMakeFiles/druntime-ldc.dir/all] Error 2 make[1]: Leaving directory '/tmp/wasm_druntime/ldc-build-runtime.tmp' make: *** [Makefile:130: all] Error 2 --- cut --
Ah yes, I missed that step. You need to patch the sdk. See the CI https://github.com/tagion/ldc/blob/828926064c52eba905d9bbbf9d4d57f64a2cd267/.azure-pipelines/posix.yml#L159 Essentially replace `Wasm` with `Linux` in $WASI_SDK_PREFIX/share/cmake/wasi-sdk.cmake
Sep 01 2020
parent cbleser <udefranette gmail.com> writes:
On Tuesday, 1 September 2020 at 16:13:46 UTC, Sebastiaan Koppe 
wrote:

 Ah yes, I missed that step. You need to patch the sdk.

 See the CI
 https://github.com/tagion/ldc/blob/828926064c52eba905d9bbbf9d4d57f64a2cd267/.azure-pipelines/posix.yml#L159

 Essentially replace `Wasm` with `Linux` in 
 $WASI_SDK_PREFIX/share/cmake/wasi-sdk.cmake
Thanks!! Now it runs. Build script can be found here. https://github.com/tagion/wasm_druntime.git
Sep 02 2020
prev sibling parent Sebastiaan Koppe <mail skoppe.eu> writes:
On Tuesday, 1 September 2020 at 13:18:15 UTC, cbleser wrote:
 On Monday, 31 August 2020 at 08:31:11 UTC, Sebastiaan Koppe 
 wrote:
 It seems you don't have the right version of 
 ldc/druntime/phobos. Please checkout 
 https://github.com/skoppe/ldc/commit/828926064c52eba905d9bbbf9d4d57f64a2cd267
Hi Sebastiaan. Thank you for you input. But still run into another problem. I corrected the branch now it compiles but it does not link. [...] --- cut --- Error: unrecognized file extension obj make[2]: *** [CMakeFiles/druntime-ldc.dir/build.make:1292: lib/libdruntime-ldc.a] Error 1 make[2]: Leaving directory '/tmp/wasm_druntime/ldc-build-runtime.tmp' make[1]: *** [CMakeFiles/Makefile2:265: CMakeFiles/druntime-ldc.dir/all] Error 2 make[1]: Leaving directory '/tmp/wasm_druntime/ldc-build-runtime.tmp' make: *** [Makefile:130: all] Error 2 --- cut --
Ah yes, I missed that step. You need to patch the toolchain. See the CI https://github.com/tagion/ldc/blob/828926064c52eba905d9bbbf9d4d57f64a2cd267/.azure-pipelines/posix.yml#L159 Essentially replace `Wasm` with `Linux` in $WASI_SDK_PREFIX/share/cmake/wasi-sdk.cmake
Sep 01 2020
prev sibling parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Thursday, 6 August 2020 at 10:15:54 UTC, Sebastiaan Koppe 
wrote:
 On Wednesday, 5 August 2020 at 21:46:49 UTC, Hipreme wrote:
 4) go into the ldc's runtime folder and run `ldc-build-runtime 
 --ninja "--dFlags=-mtriple=wasm32-wasi" --ldcSrcDir=../ 
 CMAKE_TOOLCHAIN_FILE="$WASI_SDK_PREFIX/share/cmake/wasi-sdk.cmake"
WASI_SDK_PREFIX=$WASI_SDK_PREFIX BUILD_SHARED_LIBS=OFF` (you may need to build
ldc-build-runtime first).
Dear Sebastiaan, I tried the steps you provided. I did it on both my ubuntu 16.04 and Win10. I am receiving the same error on both. I used WASI-SDK 11 for windows because it is the lowest version supporting windows. And please note that the latest WASI-SDK 12 raises some cmake errors that I cannot remember as of writing this. This one is from Win10 ldc-build-runtime --ninja "--dFlags=-mtriple=wasm32-wasi" --ldcSrcDir=../ CMAKE_TOOLCHAIN_FILE="%WASI_SDK_PREFIX%/share/cmake/wasi-sdk.cmake" WASI_SDK_PREFIX=%WASI_SDK_PREFIX% BUILD_SHARED_LIBS=OFF output: https://gist.github.com/aferust/8dfbce368ebdf6b40e54ce9e9e12daa4 I reported my issues here as you said in your e-mail. Thanks.
Dec 16 2020
parent reply kinke <noone nowhere.com> writes:
On Wednesday, 16 December 2020 at 20:07:44 UTC, Ferhat Kurtulmuş 
wrote:
 I am receiving the same error on both.
Looks like you're using LDC v1.24 to compile that older patched druntime - that won't work, compiler and druntime are tightly coupled. So you'll either need the LDC of that time, or rebase Sebastiaan's changes on top of https://github.com/ldc-developers/druntime/tree/ldc-v1.24.0.
Dec 16 2020
parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Wednesday, 16 December 2020 at 22:41:55 UTC, kinke wrote:
 On Wednesday, 16 December 2020 at 20:07:44 UTC, Ferhat 
 Kurtulmuş wrote:
 I am receiving the same error on both.
Looks like you're using LDC v1.24 to compile that older patched druntime - that won't work, compiler and druntime are tightly coupled. So you'll either need the LDC of that time, or rebase Sebastiaan's changes on top of https://github.com/ldc-developers/druntime/tree/ldc-v1.24.0.
Oh, I see. Thank you. I will take that into account.
Dec 17 2020
parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
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 
 Kurtulmuş wrote:
 I am receiving the same error on both.
Looks like you're using LDC v1.24 to compile that older patched druntime - that won't work, compiler and druntime are tightly coupled. So you'll either need the LDC of that time, or rebase Sebastiaan's changes on top of https://github.com/ldc-developers/druntime/tree/ldc-v1.24.0.
Oh, I see. Thank you. I will take that into account.
Atleast so far I could compile it on Windows using: ldc2-1.20 wasi-sdk-11.0
 Essentially replace `Wasm` with `Linux` in 
 $WASI_SDK_PREFIX/share/cmake/wasi-sdk.cmake
But I have to add `version (WebAssembly){}else:` at the beginnings of the files related with cpp: core/stdcpp/ exception.d, /new_d, /string_view.d, /typeinfo.d.
Dec 17 2020
parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
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>
Dec 18 2020
parent reply kinke <noone nowhere.com> writes:
On Friday, 18 December 2020 at 12:32:53 UTC, Ferhat Kurtulmuş 
wrote:
 import path[0] = D:\dlang\ldc\runtime\druntime\src>
 import path[1] = D:\dlang\ldc\runtime\phobos>
Your ldc2.conf is wrong, get rid of the trailing `>` in the import and lib paths. You also don't need -mtriple in dub.json; that's added by dub with the `--arch` option.
Dec 18 2020
parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Friday, 18 December 2020 at 13:29:17 UTC, kinke wrote:
 On Friday, 18 December 2020 at 12:32:53 UTC, Ferhat Kurtulmuş 
 wrote:
 import path[0] = D:\dlang\ldc\runtime\druntime\src>
 import path[1] = D:\dlang\ldc\runtime\phobos>
Your ldc2.conf is wrong, get rid of the trailing `>` in the import and lib paths. You also don't need -mtriple in dub.json; that's added by dub with the `--arch` option.
Yes, that was the problem. I didn't even know such a file exists. Thank you again.
Dec 18 2020
parent Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Friday, 18 December 2020 at 17:53:39 UTC, Ferhat Kurtulmuş 
wrote:
 On Friday, 18 December 2020 at 13:29:17 UTC, kinke wrote:
 On Friday, 18 December 2020 at 12:32:53 UTC, Ferhat Kurtulmuş 
 wrote:
 import path[0] = D:\dlang\ldc\runtime\druntime\src>
 import path[1] = D:\dlang\ldc\runtime\phobos>
Your ldc2.conf is wrong, get rid of the trailing `>` in the import and lib paths. You also don't need -mtriple in dub.json; that's added by dub with the `--arch` option.
Yes, that was the problem. I didn't even know such a file exists. Thank you again.
Just for records, in my case, I could compile the test code with some workarounds due to missing symbols although I switched back to wasm-sdk-8. extern(C) void proc_exit(int exitcode){ import core.stdc.stdlib; exit(exitcode); } extern(C) int __wasi_clock_res_get(uint32_t id, uint64_t* resolution); extern(C) int clock_res_get(uint32_t id, uint64_t* resolution){ return __wasi_clock_res_get(id, resolution); } extern(C) int __wasi_clock_time_get(uint32_t id, uint64_t precision, uint64_t* time); extern(C) int clock_time_get(uint32_t id, uint64_t precision, uint64_t* time){ return __wasi_clock_time_get(id, precision, time); }
Dec 18 2020