我正在尝试在Raspberry Pi上编译GHC 7.6.3。 Raspbian附带的7.4版GHC不支持 ghci 。 我打算打包v 7.6.3并使其可用。
经过一段时间后,我在Pi上得到了这个错误:
HC [stage 0] utils/hp2ps/dist/build/Key.o
HC [stage 0] utils/hp2ps/dist/build/PsFile.o
HC [stage 0] utils/hp2ps/dist/build/Shade.o
HC [stage 0] utils/hp2ps/dist/build/Utilities.o
"inplace/bin/mkdirhier" utils/hp2ps/dist/build/tmp//.
HC [stage 0] utils/hp2ps/dist/build/tmp/hp2ps
Warning: -rtsopts and -with-rtsopts have no effect with -no-hs-main.
Call hs_init_ghc() from your main() function to set these options.
"cp" -p utils/hp2ps/dist/build/tmp/hp2ps inplace/bin/hp2ps
cp driver/ghc-usage.txt inplace/lib/ghc-usage.txt
cp driver/ghci-usage.txt inplace/lib/ghci-usage.txt
HC [stage 0] utils/genapply/dist/build/GenApply.o
"inplace/bin/mkdirhier" utils/genapply/dist/build/tmp//.
HC [stage 0] utils/genapply/dist/build/tmp/genapply
"cp" -p utils/genapply/dist/build/tmp/genapply inplace/bin/genapply
HC [stage 1] libraries/ghc-prim/dist-install/build/GHC/Types.o
Stack dump:
0. Program arguments: /usr/bin/llc -O3 -relocation-model=static /tmp/ghc467_0/ghc467_0.bc -o /tmp/ghc467_0/ghc467_0.lm_s --enable-tbaa=true
1. Running pass 'Function Pass Manager' on module '/tmp/ghc467_0/ghc467_0.bc'.
2. Running pass 'ARM Instruction Selection' on function '@ghczmprim_GHCziTypes_Dzh_info'
/tmp/ghc467_0/ghc467_0.lm_s: openBinaryFile: does not exist (No such file or directory)
make[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1
make: *** [all] Error 2
real 308m59.437s
user 292m8.320s
sys 10m18.220s
知道出了什么问题吗?
如何最终找到由构建系统生成的缺少的中间文件?
答案 0 :(得分:2)
我从上游来源使用Raspberry PI编译了GHC-7.8.3。它不是很快,但它完成了工作:
pi@arlanda ~ $ ghci
GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> 1+1
2
关键是要做到以下几点:
fdisk
中选择分区类型为Linux swap,然后执行mkswap /dev/sdXX
,最后执行swapon /dev/sdXX
,其中XX
是磁盘ID字母和分区号。rpi-update
将内核更新到最新版本以防止挂起。我还在smsc95xx.turbo_mode=N slub_debug=FP
文件的内核命令行末尾添加了/boot/cmdline.txt
。apt-get install binutils-gold
安装黄金链接器,因为常规ld.bfd
将无法创建动态库。问题是您无法使用gold
链接所有内容,但需要将第1阶段与ld.bfd
相关联。您需要按照in this script(original information from here)的说明操作,但需要使用ld.bfd
来运行初始./configure
电话。答案 1 :(得分:0)
您可以随时查看R-Pi的官方haskell页面。希望它能帮助你,而不是帮助我。那里有一些非常有用的链接。