如何从 GHC 获取 Snow Leopard 的 64 位二进制文件?
我最近将操作系统升级到 Snow Leopard,这破坏了我的 GHC。我能够通过在 /usr/bin/ghc 中添加 32 位编译标志(类似于 -optl -m32 -opta -m32 -optc -m32,收集自 此处)。现在我无法让它为我的另一台支持 64 位的机器生成 64 位二进制文件。 32 位标志会损坏,删除它们也会损坏。有什么建议吗?
当我尝试编译时,我得到这样的东西:
/var/folders/az/az3Ef9shFZq6RajmTEBwu++++TI/-Tmp-//ghc8006_0/ghc8006_0.s:212:0:
32-bit absolute addressing is not supported for x86-64
/var/folders/az/az3Ef9shFZq6RajmTEBwu++++TI/-Tmp-//ghc8006_0/ghc8006_0.s:212:0:
cannot do signed 4 byte relocation
/var/folders/az/az3Ef9shFZq6RajmTEBwu++++TI/-Tmp-//ghc8006_0/ghc8006_0.s:215:0:
32-bit absolute addressing is not supported for x86-64
/var/folders/az/az3Ef9shFZq6RajmTEBwu++++TI/-Tmp-//ghc8006_0/ghc8006_0.s:215:0:
cannot do signed 4 byte relocation
谢谢!
I've recently upgraded my OS to Snow Leopard, which broke my GHC. I was able to fix it on one machine by adding flags for 32-bit compiles in /usr/bin/ghc (something like -optl -m32 -opta -m32 -optc -m32, gathered from here). Now I can't get it to produce 64-bit binaries for my other machine, which supports 64-bits. The 32-bit flags break, and removing them breaks as well. Any tips?
When I try to compile I get stuff like this:
/var/folders/az/az3Ef9shFZq6RajmTEBwu++++TI/-Tmp-//ghc8006_0/ghc8006_0.s:212:0:
32-bit absolute addressing is not supported for x86-64
/var/folders/az/az3Ef9shFZq6RajmTEBwu++++TI/-Tmp-//ghc8006_0/ghc8006_0.s:212:0:
cannot do signed 4 byte relocation
/var/folders/az/az3Ef9shFZq6RajmTEBwu++++TI/-Tmp-//ghc8006_0/ghc8006_0.s:215:0:
32-bit absolute addressing is not supported for x86-64
/var/folders/az/az3Ef9shFZq6RajmTEBwu++++TI/-Tmp-//ghc8006_0/ghc8006_0.s:215:0:
cannot do signed 4 byte relocation
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
自 2011 年起,Haskell 平台的 64 位 Snow Leopard 安装程序可用。
64 bit Snow Leopard installers for the Haskell Platform are available, as of 2011.
我的理解是,目前 ghc 无法在 Snow Leopard 下生成正确的 64 位二进制文件。这似乎部分是由于 64 位链接生成中的错误,部分是由于本机工具链的更改。您提到的解决方法只是告诉它生成 32 位目标,因此不会成为您问题的任何实际解决方案的一部分。
My understanding is that at the moment ghc cannot generate correct 64 bit binaries under Snow Leopard. This appears to be in part because of a bug in its 64 bit link generation and in part because of a change in the native toolchain. The workaround you mention simply tells it to generate a 32 bit target and thus won't be part of any actual solution to your problem.