Browse Source

[PATCH 61/83] adding wasmtool call

From 076dede20de13f7d4e321976c171b7a009652f2e Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <[email protected]>
Date: Fri, 27 Sep 2019 22:30:42 -0400

git-svn-id: branches/wasm@45938 -
nickysn 5 years ago
parent
commit
9599422330
1 changed files with 12 additions and 1 deletions
  1. 12 1
      compiler/wasm/agwat.pas

+ 12 - 1
compiler/wasm/agwat.pas

@@ -37,7 +37,8 @@ interface
     ,cutils
     ,cpubase
     ,fmodule
-    ,verbose, itcpuwasm;
+    ,verbose, itcpuwasm
+    ,cfileutl;
 
   type
      TWatInstrWriter = class;
@@ -74,6 +75,7 @@ interface
        constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
        procedure WriteTree(p:TAsmList);override;
        procedure WriteAsmList;override;
+       Function  DoAssemble:boolean;override;
      end;
 
 
@@ -613,6 +615,15 @@ implementation
         writer.AsmLn;
       end;
 
+    function TWabtTextAssembler.DoAssemble: boolean;
+      begin
+        Result:=inherited DoAssemble;
+        // the tool updates the symbol flags, so the linker
+        // is capable of producing an executable
+        if Result then 
+          RequotedExecuteProcess('wasmtool',' --symbolauto '+ObjFileName);
+      end;
+
     constructor TWabtTextAssembler.CreateWithWriter(info: pasminfo;
       wr: TExternalAssemblerOutputFile; freewriter, smart: boolean);
       begin