瀏覽代碼

Merged revision(s) 28237 from branches/svenbarth/packages:
Add a new target flag which determines whether the target supports dynamic packages or not.

systems.pas:
+ new flag tf_supports_packages
pmodules.pas, proc_package:
* error out when flag tf_supports_packages is not set for the current target
msg/errore.msg:
+ error message for when tf_supports_packages is missing and a package file is compiled
........

git-svn-id: trunk@32978 -

svenbarth 9 年之前
父節點
當前提交
e9d8fadb58
共有 3 個文件被更改,包括 11 次插入2 次删除
  1. 4 1
      compiler/msg/errore.msg
  2. 3 0
      compiler/pmodules.pas
  3. 4 1
      compiler/systems.pas

+ 4 - 1
compiler/msg/errore.msg

@@ -413,7 +413,7 @@ scan_e_illegal_hugepointernormalization=02098_E_Illegal argument for HUGEPOINTER
 #
 #
 # Parser
 # Parser
 #
 #
-# 03343 is the last used one
+# 03344 is the last used one
 #
 #
 % \section{Parser messages}
 % \section{Parser messages}
 % This section lists all parser messages. The parser takes care of the
 % This section lists all parser messages. The parser takes care of the
@@ -1544,6 +1544,9 @@ parser_e_no_genfuncs_in_interfaces=03342_E_Generic methods are not allowed in in
 parser_e_genfuncs_cannot_be_virtual=03343_E_Generic methods can not be virtual
 parser_e_genfuncs_cannot_be_virtual=03343_E_Generic methods can not be virtual
 % Generic methods can not be declared as virtual as there'd need to be a VMT entry for each
 % Generic methods can not be declared as virtual as there'd need to be a VMT entry for each
 % specialization. This is however not possible with a static VMT.
 % specialization. This is however not possible with a static VMT.
+parser_e_packages_not_supported=03344_E_Dynamic packages not supported for target OS
+% Support for dynamic packages is not implemented for the specified target OS
+% or it is at least not tested and thus disabled.
 %
 %
 %
 %
 % \end{description}
 % \end{description}

+ 3 - 0
compiler/pmodules.pas

@@ -1666,6 +1666,9 @@ type
          init_procinfo:=nil;
          init_procinfo:=nil;
          finalize_procinfo:=nil;}
          finalize_procinfo:=nil;}
 
 
+         if not (tf_supports_packages in target_info.flags) then
+           message1(parser_e_packages_not_supported,target_info.name);
+
          if not RelocSectionSetExplicitly then
          if not RelocSectionSetExplicitly then
            RelocSection:=true;
            RelocSection:=true;
 
 

+ 4 - 1
compiler/systems.pas

@@ -148,7 +148,10 @@ interface
             { indicates that the default value of the ts_cld target switch is 'on' for this target }
             { indicates that the default value of the ts_cld target switch is 'on' for this target }
             tf_cld,
             tf_cld,
             { indicates that the default value of the ts_x86_far_procs_push_odd_bp target switch is 'on' for this target }
             { indicates that the default value of the ts_x86_far_procs_push_odd_bp target switch is 'on' for this target }
-            tf_x86_far_procs_push_odd_bp
+            tf_x86_far_procs_push_odd_bp,
+            { indicates that this target can use dynamic packages otherwise an
+              error will be generated if a package file is compiled }
+            tf_supports_packages
        );
        );
 
 
        psysteminfo = ^tsysteminfo;
        psysteminfo = ^tsysteminfo;