ghc armv7 binary + cabal? 非法指令

我正在尝试在最新发布的armv7的ghc二进制文件上启动和运行覆盆子pi 2,可在此处获得:

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

这说它是用debian jesse构建的,所以我在我的pi2上安装了debian jesse。 我已经成功安装了ghc - 至少ghci的作品。 但是没有cabal,很明显ghc 7.10.2需要cabal 1.22+。 cabal的debian版本类似于1.16(也可以安装ghc 7.6.x)。 所以我试图用bootstrap.sh脚本从源代码安装cabal-install。 那下载mtl包并建立一个'Setup'可执行文件,然后尝试执行它。 但是,安装程序exe会因'非法指令'失败。

根据下载页面,“黄金”链接器是必需的。 我通过这样做补充说

ln -s which gold / bin / ld

并设置我的路径包括〜/ bin。 不幸的是,结果同

接下来,我尝试用黄金重新安装ghc二进制文件(我认为)。 作为根:

> ln -s `which gold` /usr/local/bin/ld
> cd ghc-7.10.2
> make install

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.

有任何想法吗?

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


好吧,终于把这个理顺了。 根据ghc下载页面,您应该使用debian jessie附带的llvm 3.5。 但默认的llvm版本是3.5-10,并且不起作用。 所需要的是3.5.2-2。

我下载了3.5.2-2的debs并安装了,但它变得非常快速,需要安装5-6 libs,llvm 3.5.2-2需要依赖地狱。 我切换到debian测试,并且更容易安装llvm。 如果你在使用debian实验,这可能会更容易些。

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

我在debian jessie上使用默认的llvm 3.5的bug:https://ghc.haskell.org/trac/ghc/ticket/10863

链接地址: http://www.djcxy.com/p/28389.html

上一篇: ghc armv7 binary + cabal? illegal instruction

下一篇: cast to pointer from integer of different size