WebAssembly/Compiler

From Free Pascal wiki
Revision as of 14:19, 21 September 2019 by Michael (talk | contribs) (Created page with "== Instructions == === Compiling the compiler === Get the sources: git clone https://github.com/skalogryz/freepascal fpc-wasm switch to correct branch: cd fpc-wasm g...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Instructions

Compiling the compiler

Get the sources:

 git clone https://github.com/skalogryz/freepascal fpc-wasm

switch to correct branch:

 cd fpc-wasm
 git checkout webasm

compile:

 cd compiler
 

Using lazarus:

 open ppcwasm.lpi

hit the "compile" button.

On the command-line:

 fpc -dnoopt -dwasm -Fiwasm -Fuwasm -Fusystems -S2 pp.pas 

the compiler can be renamed

 mv pp ppwasm

or, on windows:

 mv pp.exe ppwasm.exe

Using the compiler

You need a system.pas unit. It can be found here:

wasm-demo

You'll also need the wasm tools:

wasm tools

Extract the binaries and put them somewhere in your path.