Create a static Haskell Linux executable

后端 未结 3 1847
庸人自扰
庸人自扰 2020-12-23 17:46

It\'s not often two things I love so much come together to cause me so much annoyance (besides my kids). I\'ve written a Haskell program at work that uses libraries like tex

3条回答
  •  孤城傲影
    2020-12-23 18:05

    This simple example "works for me":

    $ cat A.hs
    main = print "yes"
    
    $ ghc -O2 --make -static -optc-static -optl-static A.hs -fvia-C -optl-pthread
    
    $ ldd A
        not a dynamic executable
    $ ./A
    "yes"
    

    (and I've used this process, via .cabal, to ship executables for clients in the past couple of years).

    I think the best bet is to file bugs, and get this working. The IHG can also fund work like this, but I'm fairly sure the GHC team would consider this a high priority, if you're trying to ship products.

提交回复
热议问题