ghc armv7二进制+ cabal?非法指令

Bzz*_*zzt 7 haskell ghc cabal

我正在尝试使用最近发布的armv7的ghc二进制文件来启动和运行raspberry pi 2,可在此处获取:

https://www.haskell.org/ghc/download_ghc_7_10_2#linux_armv7

这说它是用debian jesse构建的,所以我在我的pi2上安装了debian jesse.我成功安装了ghc - 至少ghci工作.但是没有阴谋,显然ghc 7.10.2要求阴谋1.22+.debian版本的cabal类似于1.16(并且还将安装ghc 7.6.x).所以我正在尝试使用bootstrap.sh脚本从源代码安装cabal-install.下载mtl包并构建一个'Setup'可执行文件,然后尝试执行它.但安装程序exe失败了"非法指令".

根据下载页面,需要'gold'链接器.我补充说,这样做

ln -s which gold~/bin/ld

并设置我的路径包括〜/ bin.遗憾的是,结果相同.

接下来,我尝试用金重新安装ghc二进制文件(我认为).所以作为root:

> ln -s `which gold` /usr/local/bin/ld
> cd ghc-7.10.2
> make install
Run Code Online (Sandbox Code Playgroud)

ghc再次成功安装,但构建cabal-install的结果是相同的:

bburdette@jessie-rpi:~/code/cabal/cabal-install$ ./bootstrap.sh 
Using gcc for C compiler. If this is not what you want, set CC.
Using /usr/lib/gcc/arm-linux-gnueabihf/4.9/collect2 instead.
Checking installed packages for ghc-7.10.2...
deepseq is already installed and the version is ok.
binary is already installed and the version is ok.
time is already installed and the version is ok.
Cabal is already installed and the version is ok.
transformers is already installed and the version is ok.
mtl-2.2.1 will be installed from local tarball.
text-1.2.0.3 will be downloaded and installed.
parsec-3.1.7 will be downloaded and installed.
network-2.6.0.2 will be downloaded and installed.
old-locale-1.0.0.7 will be downloaded and installed.
old-time-1.1.0.3 will be downloaded and installed.
HTTP-4000.2.19 will be downloaded and installed.
zlib-0.5.4.2 will be downloaded and installed.
random-1.1 will be downloaded and installed.
stm-2.4.4 will be downloaded and installed.

Using local tarball for mtl-2.2.1.
[1 of 1] Compiling Main             ( Setup.hs, Setup.o )
Linking Setup ...
Illegal instruction

Error during cabal-install bootstrap:
Configuring the mtl package failed.
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

我想知道符号链接是否是为此启用黄金的正确方法?也许我需要在每个cabal项目中添加它作为ghc选项,还是有其他方法可以使用黄金?或许这根本不是问题?

Bzz*_*zzt 3

好的,终于解决了这个问题。根据 ghc 下载页面,您应该使用 debian jessie 附带的 llvm 3.5。但默认的 llvm 版本是 3.5-10,这不起作用。需要的是 3.5.2-2。

我下载了 3.5.2-2 的 debs 并安装了,但它很快就变成了依赖地狱,需要安装 llvm 3.5.2-2 所需的 5-6 个库。我切换到 debian 测试,安装 llvm 更容易。如果您使用的是 Debian 实验版,这可能会更容易。

我使用的 ghc 7.10.2 软件包: https ://packages.debian.org/experimental/armhf/ghc/download

我在 debian jessie 上使用默认的 llvm 3.5 时遇到的错误: https://ghc.haskell.org/trac/ghc/ticket/10863