【问题标题】:Error with Cabal Mac OS(snow leopard) - ld: unknown option: -no_pieCabal Mac OS(雪豹)出错-ld:未知选项:-no_pie
【发布时间】:2011-12-31 12:08:45
【问题描述】:

我正在尝试使用 cabal 来安装一些软件包,但出现如下错误:

Resolving dependencies...
[1 of 1] Compiling Main             ( /var/folders/qA/qAV3z3wUGnOKfufb0vx2N++++TI/-Tmp-/HUnit-1.2.4.229829/HUnit-1.2.4.2/Setup.hs, /var/folders/qA/qAV3z3wUGnOKfufb0vx2N++++TI/-Tmp-/HUnit-1.2.4.229829/HUnit-1.2.4.2/dist/setup/Main.o )

/var/folders/qA/qAV3z3wUGnOKfufb0vx2N++++TI/-Tmp-/HUnit-1.2.4.229829/HUnit-1.2.4.2/Setup.hs:6:1:
    Warning: In the use of `runTests'
             (imported from Distribution.Simple, but defined in Distribution.Simple.UserHooks):
             Deprecated: "Please use the new testing interface instead!"
Linking /var/folders/qA/qAV3z3wUGnOKfufb0vx2N++++TI/-Tmp-/HUnit-1.2.4.229829/HUnit-1.2.4.2/dist/setup/setup ...
ld: unknown option: -no_pie
collect2: ld returned 1 exit status
[1 of 1] Compiling Main             ( /var/folders/qA/qAV3z3wUGnOKfufb0vx2N++++TI/-Tmp-/syb-0.3.629829/syb-0.3.6/Setup.hs, /var/folders/qA/qAV3z3wUGnOKfufb0vx2N++++TI/-Tmp-/syb-0.3.629829/syb-0.3.6/dist/setup/Main.o )

/var/folders/qA/qAV3z3wUGnOKfufb0vx2N++++TI/-Tmp-/syb-0.3.629829/syb-0.3.6/Setup.hs:4:30:
    Warning: In the use of `runTests'
             (imported from Distribution.Simple, but defined in Distribution.Simple.UserHooks):
             Deprecated: "Please use the new testing interface instead!"
Linking /var/folders/qA/qAV3z3wUGnOKfufb0vx2N++++TI/-Tmp-/syb-0.3.629829/syb-0.3.6/dist/setup/setup ...
ld: unknown option: -no_pie
collect2: ld returned 1 exit status
cabal: Error: some packages failed to install:
Crypto-4.2.4 depends on HUnit-1.2.4.2 which failed to install.
HUnit-1.2.4.2 failed during the configure step. The exception was:
ExitFailure 1
aeson-0.4.0.1 depends on syb-0.3.6 which failed to install.
snap-0.7 depends on syb-0.3.6 which failed to install.
snap-core-0.7.0.1 depends on HUnit-1.2.4.2 which failed to install.
snap-server-0.7.0.1 depends on HUnit-1.2.4.2 which failed to install.
syb-0.3.6 failed during the configure step. The exception was:
ExitFailure 1

有人遇到过类似情况吗?

【问题讨论】:

  • 我认为问题出在:ld: unknown option:-no_pie command
  • 您使用的是什么版本的 GHC 和 Cabal-install?基本错误是 HUnit 安装失败,但是 HUnit 是一个非常稳定的包(它只依赖于 Base,据我所知不使用 FFI,HUnit 编译的所有版本)所以你真的应该有问题安装它。
  • 你能把运行ld -v的结果粘贴到你的终端吗?

标签: haskell cabal


【解决方案1】:

貌似豹子摆脱了no-pie一段时间:http://trac.macports.org/ticket/34064

据我所知,要么它已恢复,要么 GHC 添加了解决方法,或两者​​兼而有之。

正如 cmets 在 GHC - Mac OS X - ld: unknown option: -no_pie 上的注释,将 xcode/ld 升级到更新版本会启用该标志

【讨论】:

    猜你喜欢
    • 2012-05-29
    • 1970-01-01
    • 2020-12-25
    • 2011-12-01
    • 2012-03-08
    • 2013-12-14
    • 2014-09-04
    • 2016-07-19
    • 2010-12-25
    相关资源
    最近更新 更多