浏览代码

* link to libpthread at compile time on Linux to avoid problems on some
newer glibc systems when it's only loaded dynamically at run time

git-svn-id: trunk@14970 -

Jonas Maebe 15 年之前
父节点
当前提交
9cd0a2ff1e
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      rtl/unix/cthreads.pp

+ 7 - 0
rtl/unix/cthreads.pp

@@ -15,6 +15,13 @@
  **********************************************************************}
 {$mode objfpc}
 {$ifdef linux}
+{ we can combine both compile-time linking and dynamic loading, in order to:
+    a) solve a problem on some systems with dynamically loading libpthread if
+       it's not linked at compile time
+    b) still enabling dynamically checking whether or not certain functions
+       are available (could also be implemented via weak linking)
+}
+{$linklib pthread}
 {$define dynpthreads} // Useless on BSD, since they are in libc
 {$endif}