diff options
author | Zoltan Varga <vargaz@gmail.com> | 2020-06-05 17:29:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-05 17:29:52 +0300 |
commit | 2321bba344049115b0a0d58fcdfba1f9cadc4280 (patch) | |
tree | 259db2e139d86c9df4c8ee6170950b258db55633 /mcs | |
parent | 0250810bc9380d370f1e5b98b2d2c8e118a11e4e (diff) |
[wasm] Fix icall linking with netcore. (#19917)
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/tools/wasm-tuner/tuner.cs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/mcs/tools/wasm-tuner/tuner.cs b/mcs/tools/wasm-tuner/tuner.cs index ac4578f22ab..3004f35cd66 100644 --- a/mcs/tools/wasm-tuner/tuner.cs +++ b/mcs/tools/wasm-tuner/tuner.cs @@ -288,21 +288,26 @@ public class WasmTuner var sorted = icalls.Where (i => i.Assembly == assembly).ToArray (); Array.Sort (sorted); - Console.WriteLine ($"#define ICALL_TABLE_{assembly} 1\n"); - - Console.WriteLine ($"static int {assembly}_icall_indexes [] = {{"); + string aname; + if (assembly == "mscorlib" || assembly == "System.Private.CoreLib") + aname = "corlib"; + else + aname = assembly.Replace (".", "_"); + Console.WriteLine ($"#define ICALL_TABLE_{aname} 1\n"); + + Console.WriteLine ($"static int {aname}_icall_indexes [] = {{"); foreach (var icall in sorted) Console.WriteLine (String.Format ("{0},", icall.TokenIndex)); Console.WriteLine ("};"); foreach (var icall in sorted) Console.WriteLine (GenIcallDecl (icall)); - Console.WriteLine ($"static void *{assembly}_icall_funcs [] = {{"); + Console.WriteLine ($"static void *{aname}_icall_funcs [] = {{"); foreach (var icall in sorted) { Console.WriteLine (String.Format ("// token {0},", icall.TokenIndex)); Console.WriteLine (String.Format ("{0},", icall.Func)); } Console.WriteLine ("};"); - Console.WriteLine ($"static uint8_t {assembly}_icall_handles [] = {{"); + Console.WriteLine ($"static uint8_t {aname}_icall_handles [] = {{"); foreach (var icall in sorted) Console.WriteLine (String.Format ("{0},", icall.Handles ? "1" : "0")); Console.WriteLine ("};"); |