+ tsettings.tlsmodel

git-svn-id: trunk@40271 -
This commit is contained in:
florian 2018-11-07 22:03:01 +00:00
parent 9c041afc7c
commit 0d50a63c7d
4 changed files with 25 additions and 0 deletions

View File

@ -164,6 +164,8 @@ interface
disabledircache : boolean;
tlsmodel : ttlsmodel;
{$if defined(i8086)}
x86memorymodel : tx86memorymodel;
{$endif defined(i8086)}
@ -556,6 +558,8 @@ interface
minfpconstprec : s32real;
disabledircache : false;
tlsmodel : tlsm_none;
{$if defined(i8086)}
x86memorymodel : mm_small;
{$endif defined(i8086)}

View File

@ -706,6 +706,13 @@ interface
);
tprocinfoflags=set of tprocinfoflag;
ttlsmodel = (tlsm_none,
{ elf tls model: works for all kind of code and thread vars }
tlsm_general,
{ elf tls model: works only if the thread vars are declared and used in the same executable }
tlsm_local
);
type
{ float types -- warning, this enum/order is used internally by the RTL
as well in rtl/inc/real2str.inc }

View File

@ -4031,6 +4031,15 @@ begin
not(cs_link_separate_dbg_file in init_settings.globalswitches) then
exclude(init_settings.globalswitches,cs_link_strip);
{ choose a reasonable tls model }
if (tf_section_threadvars in target_info.flags) and (init_settings.tlsmodel=tlsm_none) then
begin
if cs_create_pic in init_settings.moduleswitches then
init_settings.tlsmodel:=tlsm_general
else
init_settings.tlsmodel:=tlsm_local;
end;
{ set Mac OS X version default macros if not specified explicitly }
option.MaybeSetDefaultMacVersionMacro;

View File

@ -3085,6 +3085,8 @@ type
minfpconstprec:=tfloattype(tokenreadenum(sizeof(tfloattype)));
disabledircache:=boolean(tokenreadbyte);
tlsmodel:=ttlsmodel(tokenreadenum(sizeof(ttlsmodel)));
{ TH: Since the field was conditional originally, it was not stored in PPUs. }
{ While adding ControllerSupport constant, I decided not to store ct_none }
{ on targets not supporting controllers, but this might be changed here and }
@ -3166,6 +3168,9 @@ type
tokenwriteenum(minfpconstprec,sizeof(tfloattype));
recordtokenbuf.write(byte(disabledircache),1);
tokenwriteenum(tlsmodel,sizeof(tlsmodel));
{ TH: See note about controllertype field in tokenreadsettings. }
{$PUSH}
{$WARN 6018 OFF} (* Unreachable code due to compile time evaluation *)