浏览代码

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';
   {$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)}
 type
   Pdl_info = ^dl_info;