2
0
Эх сурвалжийг харах

* ignore the '-gl' parameter on WebAssembly, since it's impossible to implement
this feature on this target. WebAssembly is a Harvard architecture and allows
no way for inspecting code addresses in stack traces from within the program
itself. Maybe a future extension to the WebAssembly spec would allow that, but
currently, it's not possible. The '-gl' option is ignored (producing only a
warning, instead of a fatal error), because not having line info should not be
fatal for most programs. It also reduces the number of test failures, since
many tests compile with '-gl', but don't actually require the line info, it's
just there for debugging purposes.

Nikolay Nikolov 11 сар өмнө
parent
commit
cad9cd22d3

+ 6 - 1
compiler/options.pas

@@ -3250,7 +3250,12 @@ begin
             if UnsetBool(More, j, opt, false) then
             if UnsetBool(More, j, opt, false) then
               exclude(init_settings.globalswitches,cs_use_lineinfo)
               exclude(init_settings.globalswitches,cs_use_lineinfo)
             else
             else
-              include(init_settings.globalswitches,cs_use_lineinfo);
+              begin
+                if target_info.system in systems_wasm then
+                  IgnoredPara('-gl')
+                else
+                  include(init_settings.globalswitches,cs_use_lineinfo);
+              end;
           end;
           end;
         'm' :
         'm' :
           begin
           begin