简体   繁体   English

在Windows上构建GHC时出错

[英]Error building GHC on Windows

While attempting to bootstrap Haskell on Windows without the Haskell Platform I ran into the following error 在没有Haskell平台的情况下尝试在Windows上引导Haskell时,我遇到了以下错误

C:\\git\\Haskell\\ghc\\libraries\\haskeline\\dist-install\\build/libHShaskeline-0.7.1.2.a: could not read symbols: Archive has no index; C:\\ git \\ Haskell \\ ghc \\ libraries \\ haskeline \\ dist-install \\ build / libHShaskeline-0.7.1.2.a:无法读取符号:存档没有索引; run ranlib to add one 运行ranlib添加一个

Note that C:\\git\\Haskell\\ghc is where I put the ghc git repo. 请注意, C:\\git\\Haskell\\ghc是我放ghc git repo的地方。

However whenever I looked at the file it appeared to be building correctly. 但是每当我查看文件时,它似乎正在构建正确。

I have attempted completely clean rebuilds, and deleting the whole repo and regetting it, everything short of deleting anything related to this build and starting fresh. 我已经尝试完全清理重建,并删除整个仓库并重新使用它,一切都没有删除任何与此构建相关的内容并重新开始。

I eventually figured out what was causing the issue, I realized it when I found the following notice on the Windows Platform notes for GHC . 我最终弄明白是什么导致了这个问题,当我在Windows平台上发现以下关于GHC的注意事项时,我意识到了这一点。

However, the makefiles do use whatever ld and ar happen to be in your path. 但是,makefile确实使用了ld和ar恰好在你的路径中。

This didn't seem right, and reading the configure script I noticed the following lines: 这似乎不对,阅读配置脚本我注意到以下几行:

mingwbin="$hardtop/inplace/mingw/bin/"
LD="${mingwbin}ld.exe"

Note that mingwbin refers to the location that the tarballs are extracted to. 请注意, mingwbin指的是tar包被提取到的位置。 Looking at the timestamps of the executables did not match up to the version that which ld returned (in /mingw/bin ). 查看可执行文件的时间戳与which ld返回的版本(在/mingw/bin )不匹配。

Given the note that meant that at some point /inplace/mingw/bin/ld.exe was being used while at another point /mingw/bin/ld.exe was being used, possibly causing the issue. 鉴于该注释意味着在某些时候使用/inplace/mingw/bin/ld.exe而在另一点使用/mingw/bin/ld.exe时,可能会导致问题。

Running the following command before make resolved the issue. 运行以下命令之前make解决了这个问题。

export PATH=/c/git/Haskell/git/inplace/mingw/bin:$PATH

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM