Преглед изворни кода

+ 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 -

nickysn пре 12 година
родитељ
комит
a48b44cfe5
3 измењених фајлова са 12 додато и 3 уклоњено
  1. 8 1
      compiler/options.pas
  2. 3 1
      compiler/systems.pas
  3. 1 1
      compiler/systems/i_msdos.pas

+ 8 - 1
compiler/options.pas

@@ -38,7 +38,8 @@ Type
     LogoWritten,
     LogoWritten,
     FPUSetExplicitly,
     FPUSetExplicitly,
     CPUSetExplicitly,
     CPUSetExplicitly,
-    OptCPUSetExplicitly: boolean;
+    OptCPUSetExplicitly,
+    CLDSetExplicitly: boolean;
     FileLevel : longint;
     FileLevel : longint;
     QuickInfo : string;
     QuickInfo : string;
     FPCBinaryPath: string;
     FPCBinaryPath: string;
@@ -1011,6 +1012,8 @@ begin
                          include(init_settings.moduleswitches,cs_create_smart);
                          include(init_settings.moduleswitches,cs_create_smart);
                     'T' :
                     'T' :
                       begin
                       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
                         if not UpdateTargetSwitchStr(copy(more,j+1,length(more)),init_settings.targetswitches,true) then
                           IllegalPara(opt);
                           IllegalPara(opt);
                         break;
                         break;
@@ -2715,6 +2718,7 @@ begin
   FPUSetExplicitly:=false;
   FPUSetExplicitly:=false;
   CPUSetExplicitly:=false;
   CPUSetExplicitly:=false;
   OptCPUSetExplicitly:=false;
   OptCPUSetExplicitly:=false;
+  CLDSetExplicitly:=false;
   FileLevel:=0;
   FileLevel:=0;
   Quickinfo:='';
   Quickinfo:='';
   ParaIncludeCfgPath:=TSearchPathList.Create;
   ParaIncludeCfgPath:=TSearchPathList.Create;
@@ -3475,6 +3479,9 @@ if (target_info.abi = abi_eabihf) then
     mm_huge:    def_system_macro('FPC_MM_HUGE');
     mm_huge:    def_system_macro('FPC_MM_HUGE');
   end;
   end;
 {$endif}
 {$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 }
   { Section smartlinking conflicts with import sections on Windows }

+ 3 - 1
compiler/systems.pas

@@ -142,7 +142,9 @@ interface
             tf_no_backquote_support,
             tf_no_backquote_support,
             { do not generate an object file when smartlinking is turned on,
             { do not generate an object file when smartlinking is turned on,
               this is usefull for architectures which require a small code footprint }
               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;
        psysteminfo = ^tsysteminfo;

+ 1 - 1
compiler/systems/i_msdos.pas

@@ -35,7 +35,7 @@ unit i_msdos;
             name         : 'MS-DOS 16-bit real mode';
             name         : 'MS-DOS 16-bit real mode';
             shortname    : 'MSDOS';
             shortname    : 'MSDOS';
             flags        : [tf_use_8_3,tf_smartlink_library,tf_smartlink_sections,
             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;
             cpu          : cpu_i8086;
             unit_env     : 'MSDOSUNITS';
             unit_env     : 'MSDOSUNITS';
             extradefines : '';
             extradefines : '';