Skip to content

Unable to build WebAssembly compiler

Summary

Running instructions to compile a WebAssembly compiler does not produce a valid result.

System Information

  • Operating system: Ubuntu 20 (via WSL2 with Windows as host)
  • Processor architecture: x86
  • Compiler version: 49af134b
  • Device: Computer

Steps to reproduce

  1. Install LLVM 11
  2. Link llvm-mc and wasm-ld with wasm32-wasi- and wasm32-embedded- prefixes in /usr/local/bin to the installed ones
  3. Clone FPC into fpc-wasm
  4. Run make all OS_TARGET=wasi CPU_TARGET=wasm32 BINUTILSPREFIX= OPT="-O-" PP=fpc in the fpc-wasm directory

What is the current bug behavior?

Compilation completes but no valid result is to be seen. An example of what might be printed before process exits:

[ 81%] Compiled package tplylib
make[2]: Leaving directory '/home/stas/fpc-wasm/packages'
make[1]: Leaving directory '/home/stas/fpc-wasm'
/usr/bin/echo Build > build-stamp.wasm32-wasi
/usr/bin/echo Build > base.build-stamp.wasm32-wasi

The contents of both wasm32-wasi files only contains Build text.

What is the expected (correct) behavior?

A compiler executable should be located somewhere in the fpc-wasm folder

Edited by Stanislav Lashmanov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information