瀏覽代碼

Explicitly load C library on Linux as already done in dl unit, to avoid wrong sartup code

Pierre Muller 2 月之前
父節點
當前提交
06b17e6371
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      rtl/inc/heaptrc.pp

+ 7 - 0
rtl/inc/heaptrc.pp

@@ -1244,6 +1244,13 @@ const
     LibDL = 'dl';
     LibDL = 'dl';
   {$endif}
   {$endif}
 {$endif}
 {$endif}
+
+{$if defined(linux)}
+    { if libc is not linked explicitly, FPC might chose the wrong startup code, as
+      libdl depends on libc on linux, this does not hurt }
+    {$linklib c}
+{$endif}
+
 {$if defined(LINUX) or defined(BSD)}
 {$if defined(LINUX) or defined(BSD)}
 type
 type
   Pdl_info = ^dl_info;
   Pdl_info = ^dl_info;