Browse Source

+ show a message and automatically switch to external linking if WebAssembly multithreading is enabled

Nikolay Nikolov 1 year ago
parent
commit
9cf31e2bb3
2 changed files with 9 additions and 1 deletions
  1. 2 1
      compiler/msg/errore.msg
  2. 7 0
      compiler/options.pas

+ 2 - 1
compiler/msg/errore.msg

@@ -3522,7 +3522,7 @@ unit_w_unsupported_esp_idf_version=10071_W_Unsupported esp-idf version
 #
 #  Options
 #
-# 11068 is the last used one
+# 11069 is the last used one
 #
 # BeginOfTeX
 %
@@ -3692,6 +3692,7 @@ option_subtarget_config_not_found=11066_E_Subtarget $1 specified but no correspo
 % Displayed if more than one \var{-t} option is specified.
 option_x_ignored=11067_N_Ignoring compiler executable suffix $1.
 % Displayed if more than one \var{-t} option is specified.
+option_wasm_threads_require_external_linker=11069_N_WebAssembly multithreading is not supported by the internal linker, switching to external linking
 % \end{description}
 # EndOfTeX
 

+ 7 - 0
compiler/options.pas

@@ -2245,6 +2245,13 @@ begin
       Message(option_too_many_exception_modes);
       StopOptions(1);
     end;
+
+  if (ts_wasm_threads in init_settings.targetswitches) and
+     not (cs_link_extern in init_settings.globalswitches) then
+    begin
+      Message(option_wasm_threads_require_external_linker);
+      include(init_settings.globalswitches,cs_link_extern);
+    end;
 {$endif}
 
 {$ifdef i8086}