Skip to content

Commit

Permalink
chore: Adjust icalls generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed May 29, 2024
1 parent 875ceb8 commit a0c8946
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Uno.Wasm.Packager/packager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1845,9 +1845,10 @@ class WasmOptions {
ofiles += $" {a.o_path}";
}

ninja.WriteLine ("build $builddir/icall-table.json: gen-runtime-icall-table");

if (link_icalls) {
ninja.WriteLine ("build $builddir/icall-table.json: gen-runtime-icall-table");

string icall_assemblies = "";
foreach (var a in assemblies.Where(a => a.culture is null)) {
if (a.name == "mscorlib" || a.name == "System")
Expand All @@ -1868,7 +1869,7 @@ class WasmOptions {

ninja.WriteLine ($"build $builddir/pinvoke-table.h: cpifdiff $builddir/pinvoke-table.h.tmp");

var icallTable = link_icalls ? "$builddir/icall-table.json" : "__static_icalls__";
var icallTable = "__static_icalls__"; // RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "__static_icalls__" : "$builddir/icall-table.json";
ninja.WriteLine ($"build $builddir/pinvoke-table.h.tmp: gen-pinvoke-table {icallTable} {pinvoke_assemblies}");

if (is_netcore)
Expand Down
4 changes: 3 additions & 1 deletion src/Uno.Wasm.Tuner/IcallTableGenerator.net5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public IcallTableGenerator(string? runtimeIcallTableFile, Func<string, string> f
ReadTable(runtimeIcallTableFile);
else
{
Log.LogMessage(MessageImportance.Low, $"Using static signatures");

foreach (var sig in _staticSignatures)
{
_signatures.Add(sig);
Expand Down Expand Up @@ -120,7 +122,7 @@ public IEnumerable<string> Generate(string? outputPath)
{
if (!_staticSignatures.Contains(sig))
{
throw new Exception("Icall signature '{sig}' is not in the static icall signatures table");
throw new Exception($"Icall signature '{sig}' is not in the static icall signatures table");
}
}

Expand Down

0 comments on commit a0c8946

Please sign in to comment.