From a48b44cfe5615cee981be8df65dab7b9c18cca28 Mon Sep 17 00:00:00 2001 From: nickysn Date: Sat, 28 Sep 2013 14:57:12 +0000 Subject: [PATCH] + added a new tsystemflag tf_cld, which indicates that ts_cld should be enabled by default on this target + tf_cld enabled for i8086-msdos (for Turbo Pascal compatibility) git-svn-id: trunk@25595 - --- compiler/options.pas | 9 ++++++++- compiler/systems.pas | 4 +++- compiler/systems/i_msdos.pas | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/compiler/options.pas b/compiler/options.pas index 5f740bf702..8149c28747 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -38,7 +38,8 @@ Type LogoWritten, FPUSetExplicitly, CPUSetExplicitly, - OptCPUSetExplicitly: boolean; + OptCPUSetExplicitly, + CLDSetExplicitly: boolean; FileLevel : longint; QuickInfo : string; FPCBinaryPath: string; @@ -1011,6 +1012,8 @@ begin include(init_settings.moduleswitches,cs_create_smart); 'T' : begin + if Pos('CLD',Upper(copy(more,j+1,length(more))))>0 then // Ugly. Is there a better way? + CLDSetExplicitly:=true; if not UpdateTargetSwitchStr(copy(more,j+1,length(more)),init_settings.targetswitches,true) then IllegalPara(opt); break; @@ -2715,6 +2718,7 @@ begin FPUSetExplicitly:=false; CPUSetExplicitly:=false; OptCPUSetExplicitly:=false; + CLDSetExplicitly:=false; FileLevel:=0; Quickinfo:=''; ParaIncludeCfgPath:=TSearchPathList.Create; @@ -3475,6 +3479,9 @@ if (target_info.abi = abi_eabihf) then mm_huge: def_system_macro('FPC_MM_HUGE'); end; {$endif} + if not option.CLDSetExplicitly and (tf_cld in target_info.flags) then + if not UpdateTargetSwitchStr('CLD', init_settings.targetswitches, true) then + InternalError(2013092801); { Section smartlinking conflicts with import sections on Windows } diff --git a/compiler/systems.pas b/compiler/systems.pas index 96f6fb46f7..7490388635 100644 --- a/compiler/systems.pas +++ b/compiler/systems.pas @@ -142,7 +142,9 @@ interface tf_no_backquote_support, { do not generate an object file when smartlinking is turned on, this is usefull for architectures which require a small code footprint } - tf_no_objectfiles_when_smartlinking + tf_no_objectfiles_when_smartlinking, + { indicates that the default value of the ts_cld target switch is 'on' for this target } + tf_cld ); psysteminfo = ^tsysteminfo; diff --git a/compiler/systems/i_msdos.pas b/compiler/systems/i_msdos.pas index b063fade87..237279d987 100644 --- a/compiler/systems/i_msdos.pas +++ b/compiler/systems/i_msdos.pas @@ -35,7 +35,7 @@ unit i_msdos; name : 'MS-DOS 16-bit real mode'; shortname : 'MSDOS'; flags : [tf_use_8_3,tf_smartlink_library,tf_smartlink_sections, - tf_no_objectfiles_when_smartlinking]; + tf_no_objectfiles_when_smartlinking,tf_cld]; cpu : cpu_i8086; unit_env : 'MSDOSUNITS'; extradefines : '';