Browse Source

+ option -Wx to generate thumb interworking safe code on arm

git-svn-id: trunk@23463 -
florian 12 years ago
parent
commit
7184306a4c
6 changed files with 33 additions and 17 deletions
  1. 2 1
      compiler/arm/aoptcpu.pas
  2. 4 2
      compiler/globtype.pas
  3. 1 0
      compiler/msg/errore.msg
  4. 1 1
      compiler/msgidx.inc
  5. 12 12
      compiler/msgtxt.inc
  6. 13 1
      compiler/options.pas

+ 2 - 1
compiler/arm/aoptcpu.pas

@@ -1581,7 +1581,8 @@ Implementation
                       into
                       into
                       b         abc
                       b         abc
                     }
                     }
-                    if MatchInstruction(p, A_STM, [C_None], [PF_FD]) and
+                    if not(ts_thumb_interworking in current_settings.targetswitches) and
+                       MatchInstruction(p, A_STM, [C_None], [PF_FD]) and
                       GetNextInstruction(p, hp1) and
                       GetNextInstruction(p, hp1) and
                       GetNextInstruction(hp1, hp2) and
                       GetNextInstruction(hp1, hp2) and
                       SkipEntryExitMarker(hp2, hp2) and
                       SkipEntryExitMarker(hp2, hp2) and

+ 4 - 2
compiler/globtype.pas

@@ -225,7 +225,8 @@ interface
          { when automatically generating getters/setters for properties, use
          { when automatically generating getters/setters for properties, use
            these strings as prefixes for the generated getters/setter names }
            these strings as prefixes for the generated getters/setter names }
          ts_auto_getter_prefix,
          ts_auto_getter_prefix,
-         ts_auto_setter_predix
+         ts_auto_setter_predix,
+         ts_thumb_interworking
        );
        );
        ttargetswitches = set of ttargetswitch;
        ttargetswitches = set of ttargetswitch;
 
 
@@ -300,7 +301,8 @@ interface
          (name: 'COMPACTINTARRAYINIT'; hasvalue: false),
          (name: 'COMPACTINTARRAYINIT'; hasvalue: false),
          (name:  'ENUMFIELDINIT';      hasvalue: false),
          (name:  'ENUMFIELDINIT';      hasvalue: false),
          (name: 'AUTOGETTERPREFIX';    hasvalue: true ),
          (name: 'AUTOGETTERPREFIX';    hasvalue: true ),
-         (name: 'AUTOSETTERPREFIX';    hasvalue: true )
+         (name: 'AUTOSETTERPREFIX';    hasvalue: true ),
+         (name: 'THUMBINTERWORKING';   hasvalue: true )
        );
        );
 
 
        { switches being applied to all CPUs at the given level }
        { switches being applied to all CPUs at the given level }

+ 1 - 0
compiler/msg/errore.msg

@@ -3626,6 +3626,7 @@ A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)
 A*2WR_Generate relocation code (Windows)
 A*2WR_Generate relocation code (Windows)
 P*2WT_Specify MPW tool type application (Classic Mac OS)
 P*2WT_Specify MPW tool type application (Classic Mac OS)
 **2WX_Enable executable stack (Linux)
 **2WX_Enable executable stack (Linux)
+A*2Wx_Generate thumb interworking safe code if possible
 **1X_Executable options:
 **1X_Executable options:
 **2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Linux)
 **2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Linux)
 **2Xd_Do not search default library path (sometimes required for cross-compiling when not using -XR)
 **2Xd_Do not search default library path (sometimes required for cross-compiling when not using -XR)

+ 1 - 1
compiler/msgidx.inc

@@ -967,7 +967,7 @@ const
   option_info=11024;
   option_info=11024;
   option_help_pages=11025;
   option_help_pages=11025;
 
 
-  MsgTxtSize = 68415;
+  MsgTxtSize = 68471;
 
 
   MsgIdxMax : array[1..20] of longint=(
   MsgIdxMax : array[1..20] of longint=(
     26,93,332,120,87,56,126,26,202,63,
     26,93,332,120,87,56,126,26,202,63,

+ 12 - 12
compiler/msgtxt.inc

@@ -1547,31 +1547,31 @@ const msgtxt : array[0..000285,1..240] of char=(
   'A*2WR_Generate relocation code (Windows)'#010+
   'A*2WR_Generate relocation code (Windows)'#010+
   'P*2WT_Specify MPW tool ty','pe application (Classic Mac OS)'#010+
   'P*2WT_Specify MPW tool ty','pe application (Classic Mac OS)'#010+
   '**2WX_Enable executable stack (Linux)'#010+
   '**2WX_Enable executable stack (Linux)'#010+
+  'A*2Wx_Generate thumb interworking safe code if possible'#010+
   '**1X_Executable options:'#010+
   '**1X_Executable options:'#010+
   '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+
   '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+
   'ux)'#010+
   'ux)'#010+
-  '**2Xd_Do not search default library path (sometimes required for cross'+
-  '-','compiling when not using -XR)'#010+
+  '**2Xd_Do not se','arch default library path (sometimes required for cro'+
+  'ss-compiling when not using -XR)'#010+
   '**2Xe_Use external linker'#010+
   '**2Xe_Use external linker'#010+
   '**2Xg_Create debuginfo in a separate file and add a debuglink section '+
   '**2Xg_Create debuginfo in a separate file and add a debuglink section '+
   'to executable'#010+
   'to executable'#010+
-  '**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)'#010+
+  '**2XD_Try to link units dynamically      (de','fines FPC_LINK_DYNAMIC)'#010+
   '**2Xi_Use internal linker'#010+
   '**2Xi_Use internal linker'#010+
-  '**2Xm_','Generate link map'#010+
+  '**2Xm_Generate link map'#010+
   '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
   '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
   's '#039'main'#039')'#010+
   's '#039'main'#039')'#010+
   'F*2Xp<x>_First search for the compiler binary in the directory <x>'#010+
   'F*2Xp<x>_First search for the compiler binary in the directory <x>'#010+
-  '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+
-  '**2Xr<x>_Set the linker'#039's r','link-path to <x> (needed for cross co'+
-  'mpile, see the ld manual for more information) (BeOS, Linux)'#010+
+  '**2XP<x>_Prepend the binuti','ls names with the prefix <x>'#010+
+  '**2Xr<x>_Set the linker'#039's rlink-path to <x> (needed for cross comp'+
+  'ile, see the ld manual for more information) (BeOS, Linux)'#010+
   '**2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, FreeBSD'+
   '**2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, FreeBSD'+
-  ', Linux, Mac OS, Solaris)'#010+
+  ', Linux, Mac OS,',' Solaris)'#010+
   '**2Xs_Strip all symbols from executable'#010+
   '**2Xs_Strip all symbols from executable'#010+
-  '**2XS_','Try to link units statically (default, defines FPC_LINK_STATIC'+
-  ')'#010+
+  '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+
   '**2Xt_Link with static libraries (-static is passed to linker)'#010+
   '**2Xt_Link with static libraries (-static is passed to linker)'#010+
-  '**2XX_Try to smartlink units             (defines FPC_LINK_SMART)'#010+
+  '**2XX_Try to smartlink units             (defines FPC_LIN','K_SMART)'#010+
   '**1*_'#010+
   '**1*_'#010+
   '**1?_Show this help'#010+
   '**1?_Show this help'#010+
-  '**1h_Shows this help ','without waiting'
+  '**1h_Shows this help without waiting'
 );
 );

+ 13 - 1
compiler/options.pas

@@ -1917,7 +1917,19 @@ begin
                           end
                           end
                         else
                         else
                           IllegalPara(opt);
                           IllegalPara(opt);
-                      end
+                      end;
+                    'x':
+                      begin
+                        if target_info.cpu=systems.cpu_arm then
+                          begin
+                            if UnsetBool(More, j, opt, false) then
+                              exclude(init_settings.targetswitches,ts_thumb_interworking)
+                            else
+                              include(init_settings.targetswitches,ts_thumb_interworking);
+                          end
+                        else
+                          IllegalPara(opt);
+                      end;
                     else
                     else
                       IllegalPara(opt);
                       IllegalPara(opt);
                   end;
                   end;