./trunk/gcc420/vcs_diff_compiler.patch 2026-07-05-09:27
diff --git a/compiler/options.pas b/compiler/options.pas
index 6763f89954..4874f5e12b 100644
--- a/compiler/options.pas
+++ b/compiler/options.pas
@@ -197,7 +197,7 @@ implementation
suppported_targets_x_smallr = systems_linux + systems_solaris + systems_android
- + systems_openbsd
+ + systems_openbsd + systems_freebsd
+ [system_i386_haiku,system_x86_64_haiku]
+ [system_i386_beos]
+ [system_m68k_amiga];
diff --git a/compiler/systems/t_bsd.pas b/compiler/systems/t_bsd.pas
index a2bcfe9c40..9845fb18ae 100644
--- a/compiler/systems/t_bsd.pas
+++ b/compiler/systems/t_bsd.pas
@@ -430,7 +430,14 @@ procedure TLinkerBSD.InitSysInitUnitName;
LinkRes.Add('-lgcc');
if linkdynamic and (Info.DynamicLinker<>'') and
not(target_info.system in systems_openbsd) then
- LinkRes.AddFileName(Info.DynamicLinker);
+ begin
+ if (sysrootpath<>'') and not(cs_link_on_target in current_settings.globalswitches) then
+ LinkRes.AddFileName(sysrootpath+Info.DynamicLinker)
+ else if (rlinkpath<>'') and not(cs_link_on_target in current_settings.globalswitches) then
+ LinkRes.AddFileName(rlinkpath+Info.DynamicLinker)
+ else
+ LinkRes.AddFileName(Info.DynamicLinker);
+ end;
if not LdSupportsNoResponseFile then
LinkRes.Add(')');
end;