mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 12:49:33 +02:00
+ declare the three magic global variables (__tls_size, __tls_align, __tls_base), created by the linker, when WebAssembly multithreading is enabled
This commit is contained in:
parent
4db653998b
commit
7475d22154
@ -350,6 +350,17 @@ uses
|
||||
STACK_POINTER_SYM = '__stack_pointer';
|
||||
{ The exception tag symbol, used for FPC exceptions }
|
||||
FPC_EXCEPTION_TAG_SYM = '__FPC_exception';
|
||||
{ Immutable global variable, created by the linker, when multithreading
|
||||
support is enabled. Contains the total size (plus padding) of all the
|
||||
threadvars, used by the program. }
|
||||
TLS_SIZE_SYM = '__tls_size';
|
||||
{ Immutable global variable, created by the linker, when multithreading
|
||||
support is enabled. Contains the alignment requirement for the thread
|
||||
local block. }
|
||||
TLS_ALIGN_SYM = '__tls_align';
|
||||
{ Mutable global variable, created by the linker, when multithreading
|
||||
support is enabled. }
|
||||
TLS_BASE_SYM = '__tls_base';
|
||||
|
||||
{*****************************************************************************
|
||||
Helpers
|
||||
|
@ -98,6 +98,13 @@ implementation
|
||||
|
||||
list.Concat(tai_globaltype.create(STACK_POINTER_SYM,wbt_i32,false));
|
||||
|
||||
if ts_wasm_threads in current_settings.targetswitches then
|
||||
begin
|
||||
list.Concat(tai_globaltype.create(TLS_SIZE_SYM,wbt_i32,true));
|
||||
list.Concat(tai_globaltype.create(TLS_ALIGN_SYM,wbt_i32,true));
|
||||
list.Concat(tai_globaltype.create(TLS_BASE_SYM,wbt_i32,false));
|
||||
end;
|
||||
|
||||
if ts_wasm_native_exceptions in current_settings.targetswitches then
|
||||
begin
|
||||
list.Concat(tai_tagtype.create(FPC_EXCEPTION_TAG_SYM, []));
|
||||
|
Loading…
Reference in New Issue
Block a user