我正在尝试在 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
知道出了什么问题吗?
我怎样才能最终丢失由构建系统生成的中间文件?
最佳答案
我从上游源获得了用 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
, 最后做交换 /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
也打电话。 关于haskell - 在树莓派上编译 Haskell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17765002/