Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why executables built with GHC 7.10.2 have dependencies with both librt and libc?

Tags:

haskell

ghc

According to https://docs.oracle.com/cd/E36784_01/html/E36873/librt-3lib.html

Historically, functions in this library provided many of the interfaces specified by the POSIX.1b Realtime Extension. See standards(5). This functionality now resides in libc(3LIB).

This library is maintained to provide backward compatibility for both runtime and compilation environments. The shared object is implemented as a filter on libc.so.1. New application development need not specify –lrt.

So currently it should link only to libc which should have everything contained in librt. The same is for libdl dependency which is contained in libc.

like image 249
The_Ghost Avatar asked Jun 21 '16 15:06

The_Ghost


1 Answers

This was raised (two years ago!) in Trac #8713, which includes a patch ghc-libs.patch that removes the librt requirement from the GHC runtime system. (The runtime system is what is pulling in librt.) Unfortunately, at the time the discussion was going it seemed that the patch broke GHC on Solaris 10 or 11. And then people just drifted away from the ticket as it often so happens on open-source projects. Maybe someone with a bunch of free time and virtual machines on her hands will come along and fix up those patches.

like image 179
hao Avatar answered Sep 23 '22 01:09

hao