How to selectively link certain system libraries statically into Haskell program binary?

前端 未结 2 1259
轮回少年
轮回少年 2021-02-05 12:47

I\'m currently developing some web application written in Haskell. All Haskell libraries are statically linked; although this "bloats" the executable, it not so much o

2条回答
  •  暖寄归人
    2021-02-05 13:20

    dcoutts posted this as a reddit comment:

    You can do exactly the same with ghc.

    gcc -c prog.c -o prog.o
    gcc prog.o libfoo.a -o prog
    

    and lo, with ghc it's the same...

    ghc -c prog.hs -o prog.o
    ghc prog.o libfoo.a -o prog 
    

提交回复
热议问题