ecstatic: Build "as static as possible" executable on Linux.

[ distribution, library, mit, program ] [ Propose Tags ] [ Report a vulnerability ]

The following stanzas in your cabal file will make sure that the executable is linked statically with all libraries except for glibc:

executable your-awesome-program
    build-tool-depends: ecstatic:ecstatic >= 0.1.0
    ghc-options: -pgml ecstatic

See README.md for background and more details.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.11.1 && <4.22), directory (>=1.0.1 && <1.4), ecstatic, process (>=1.4.3.0 && <1.7) [details]
Tested with ghc ==9.12.2
License MIT
Author slycelote
Maintainer slycelot@yandex.ru
Category Distribution
Uploaded by slycelote at 2025-10-14T21:59:11Z
Distributions
Executables ecstatic
Downloads 3 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2025-10-14 [all 1 reports]

Readme for ecstatic-0.1.0.0

[back to package description]

ecstatic

This package provides a way to build "as static as possible" Haskell Linux executable.

Why?

On Linux, using -static gcc flag will link all libraries statically, including libc, which is explicitly not supported. The correct way to build redistributable Linux executables is to statically link everything except for libc (and link against an older glibc version, for maximum compatibility), but ghc doesn't make it easy. ecstatic is a drop-in replacement for the linker that will do the correct thing.

Usage

Add this to the executable section of your cabal file:

    build-tool-depends: ecstatic:ecstatic >= 0.1.0
    ghc-options: -pgml ecstatic

You likely want to link dynamically by default; add a configuration flag:

Flag distrib
  description: Build redistributable executable
  default: False
  manual: True

...

executable your-awesome-program
  if flag(distrib) {
    build-tool-depends: ecstatic:ecstatic >= 0.1.0
    ghc-options: -pgml ecstatic
  }