Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Haskell
Wiki community
Recent changes
Random page
HaskellWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
OpenWRT
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Native GHC for musl == Given the issues with cabal and Template Haskell when cross-compiling, the best solution (for x86_64, at least) may be a native GHC compiler which is linked against musl. [https://mail.haskell.org/pipermail/haskell-cafe/2015-May/119843.html Marios Titas has a haskell-cafe post] and a [https://github.com/redneb/ghc-alt-libc/ github repository] about a musl-native ghc toolchain. If you prefer Docker over chroot, there is [https://hub.docker.com/r/nilcons/ghc-musl/ a Docker image] based on [https://alpinelinux.org/about/ Alpine Linux], and the corresponding Dockerfile is [https://github.com/nilcons/ghc-musl on github]. Here is an example of using that Docker image to build a static executable with cabal: <pre> ppelletier@patrick64:~$ sudo docker run -it nilcons/ghc-musl:cabal sh Unable to find image 'nilcons/ghc-musl:cabal' locally cabal: Pulling from nilcons/ghc-musl c862d82a67a2: Pull complete 00b183080618: Pull complete 7193868286e6: Pull complete a3ed95caeb02: Pull complete bbfc077cc684: Pull complete Digest: sha256:27657bba49ed54b57d10c964ff59fc275d47d26e3e3a8e5991c61edc9f5f40b2 Status: Downloaded newer image for nilcons/ghc-musl:cabal / # cabal update Downloading the latest package list from hackage.haskell.org / # cabal install --ghc-option=-optl-static hello Resolving dependencies... Configuring hello-1.0.0.2... Building hello-1.0.0.2... Installed hello-1.0.0.2 / # which hello /root/.cabal/bin/hello / # hello Hello, World! / # file /root/.cabal/bin/hello /root/.cabal/bin/hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped / # ldd /root/.cabal/bin/hello ldd: /root/.cabal/bin/hello: Not a valid dynamic program </pre> [[Category:OS]]
Summary:
Please note that all contributions to HaskellWiki are considered to be released under simple permissive license (see
HaskellWiki:Copyrights
for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!
Cancel
Editing help
(opens in new window)
Toggle limited content width