瀏覽代碼

* fix usage of ppumove generated shared libraries

git-svn-id: trunk@43495 -
florian 5 年之前
父節點
當前提交
13ab35e3ef
共有 1 個文件被更改,包括 16 次插入5 次删除
  1. 16 5
      compiler/pmodules.pas

+ 16 - 5
compiler/pmodules.pas

@@ -126,10 +126,10 @@ implementation
         current_module.headerflags:=current_module.headerflags or uf_static_linked;
         current_module.headerflags:=current_module.headerflags or uf_static_linked;
 
 
         if create_smartlink_library then
         if create_smartlink_library then
-         begin
-           current_module.linkunitstaticlibs.add(current_module.staticlibfilename ,link_smart);
-           current_module.headerflags:=current_module.headerflags or uf_smart_linked;
-         end;
+          begin
+            current_module.linkunitstaticlibs.add(current_module.staticlibfilename ,link_smart);
+            current_module.headerflags:=current_module.headerflags or uf_smart_linked;
+          end;
         if cs_lto in current_settings.moduleswitches then
         if cs_lto in current_settings.moduleswitches then
           begin
           begin
             current_module.linkunitofiles.add(ChangeFileExt(current_module.objfilename,LTOExt),link_lto);
             current_module.linkunitofiles.add(ChangeFileExt(current_module.objfilename,LTOExt),link_lto);
@@ -2475,7 +2475,18 @@ type
                  hp:=tmodule(loaded_units.first);
                  hp:=tmodule(loaded_units.first);
                  while assigned(hp) do
                  while assigned(hp) do
                   begin
                   begin
-                    if (hp<>sysinitmod) and ((hp.headerflags and uf_in_library)=0) then
+                    if (hp<>sysinitmod) {
+                      I commented the following condition as it breaks linking with units being shared libs.
+                      The needed shared libs and object files are ignored
+
+                       and ((hp.headerflags and uf_in_library)=0)
+
+                      I think the right condition is
+
+                      not(assigned(hp.package))
+
+                      as later on for packages the right shared libs are added separately (FK)
+                      } then
                       begin
                       begin
                         linker.AddModuleFiles(hp);
                         linker.AddModuleFiles(hp);
                         if mf_checkpointer_called in hp.moduleflags then
                         if mf_checkpointer_called in hp.moduleflags then