What is difference between .hi .p_hi and .dyn_hi files generated by GHC

Viewed 191

I am trying to reduce size of an archive containing Nix derivations. I noticed that every module has 3 files hi, p_hi and dyn_hi all similar size.

ghc (hint) interpreter requires only hi and if I remove rest variations nothing happens.

So are p_hi and dyn_hi kind of sand bags?

1 Answers

In general .hi files are interface definitions for the associated .o object files. Older versions of GHC could only work with one version at a time. This caused issues when a library needed profiling information or dynamic linking as the library would need to be compiled with the new options each time.

To solve this issue GHC added additional functionality that let it have separate object and interface files installed alongside each other.

The .p_* files are compiled with profiling enabled. The .dyn_* are compiled to enable dynamic linking.

Related