About supporting EMScripten

cbleser udefranette at gmail.com
Tue Sep 1 13:18:15 UTC 2020


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?




More information about the digitalmars-d-ldc mailing list