summaryrefslogtreecommitdiff
path: root/lang/fpc-devel/files/patch-compiler-systems_t__bsd.pas
blob: 3d4b57df7478f3b1ce6e1e54327a5594ccbf0e33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- compiler/systems/t_bsd.pas	2023-10-27 23:25:22.849393000 -0500
+++ compiler/systems/t_bsd.pas	2023-10-27 23:26:39.226882000 -0500
@@ -115,6 +115,8 @@
   if not Dontlinkstdlibpath Then
    if target_info.system in systems_openbsd then
      LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib;=$OPENBSD_X11BASE/lib;=$OPENBSD_LOCALBASE/lib',true)
+   else if target_info.system in systems_freebsd then
+     LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib;=$FREEBSD_LOCALBASE/lib',true)
    else
      LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib;=/usr/lib;=/usr/X11R6/lib',true);
 end;
@@ -130,7 +132,9 @@
   if cs_link_lld in current_settings.globalswitches then
     LdProgram:='ld.lld'
   else if target_info.system in (systems_openbsd+systems_freebsd+[system_x86_64_dragonfly]) then
-    LdProgram:='ld.bfd';
+    LdProgram:=GetEnvPChar('FPC_LDPATH');
+    if not FileExists(LdProgram,True) then
+       LdProgram:='ld.bfd';
   LibrarySuffix:=' ';
   LdSupportsNoResponseFile := (target_info.system in ([system_m68k_netbsd]+systems_darwin));
   with Info do