Why are executable files created using GHC 7.10.2 have dependencies with both librt and libc?

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

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

This library is supported for backward compatibility for both runtime and compilation environments. The shared object is implemented as a filter on libc.so.1. New application development does not require -lrt.

Therefore, at present, it should only reference libc, which should have everything contained in librt. The same goes for the libdl dependency contained in libc.

+5
source share
1 answer

This was raised (two years ago!) In TraC # 8713 , which includes the ghc-libs.patch , which removes the librt request from the GHC runtime system, (The runtime system is what pulls into librt .) Unfortunately, in while the discussion was going on, it seemed that the patch broke GHC on Solaris 10 or 11. And then people just left the ticket, as is often the case with open source projects. Maybe someone with a bunch of free time and virtual machines in their hands will come and fix these patches.

+5
source

All Articles