+ always (even when multithreading is off) create a "target features" section

in the WebAssembly object writer, since we still require some (very commonly
  supported) extensions, even without multithreading
This commit is contained in:
Nikolay Nikolov 2022-07-16 07:42:53 +03:00
parent bf17a84dd2
commit 972a9df031

View File

@ -1844,6 +1844,14 @@ implementation
WriteName(FWasmCustomSections[wcstTargetFeatures],'mutable-globals');
WriteUleb(FWasmCustomSections[wcstTargetFeatures],$2B);
WriteName(FWasmCustomSections[wcstTargetFeatures],'sign-ext');
end
else
begin
WriteUleb(FWasmCustomSections[wcstTargetFeatures],2);
WriteUleb(FWasmCustomSections[wcstTargetFeatures],$2B);
WriteName(FWasmCustomSections[wcstTargetFeatures],'bulk-memory');
WriteUleb(FWasmCustomSections[wcstTargetFeatures],$2B);
WriteName(FWasmCustomSections[wcstTargetFeatures],'sign-ext');
end;
{ Write the producers section:
@ -1999,11 +2007,8 @@ implementation
MaybeWriteRelocationDebugTable(wcstRelocDebugRanges,debug_ranges_section_nr,FWasmRelocationDebugRangesTableEntriesCount,FWasmRelocationDebugRangesTable);
WriteWasmCustomSection(wcstProducers);
Inc(section_nr);
if ts_wasm_threads in current_settings.targetswitches then
begin
WriteWasmCustomSection(wcstTargetFeatures);
Inc(section_nr);
end;
WriteWasmCustomSection(wcstTargetFeatures);
Inc(section_nr);
result:=true;
end;