From 13ab35e3efa733623f0af62b3f21757b4de8e481 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 16 Nov 2019 14:07:32 +0000 Subject: [PATCH] * fix usage of ppumove generated shared libraries git-svn-id: trunk@43495 - --- compiler/pmodules.pas | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/compiler/pmodules.pas b/compiler/pmodules.pas index 79deced12d..2edd2d2026 100644 --- a/compiler/pmodules.pas +++ b/compiler/pmodules.pas @@ -126,10 +126,10 @@ implementation current_module.headerflags:=current_module.headerflags or uf_static_linked; 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 begin current_module.linkunitofiles.add(ChangeFileExt(current_module.objfilename,LTOExt),link_lto); @@ -2475,7 +2475,18 @@ type hp:=tmodule(loaded_units.first); while assigned(hp) do 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 linker.AddModuleFiles(hp); if mf_checkpointer_called in hp.moduleflags then