3

When I try to compile a simple Hello World in Haskell and compile with
ghc --make Main.hs
I get:
Linking Main ...
ld: unknown option: -no_pie
collect2: ld returned 1 exit status

I'm on Mac OS X 10.6.8. I used to be able to compile without this error, but I haven't used GHC for a while, so I must've installed or broken something in that period.

Brandon oubiub
  • 311
  • 1
  • 3
  • 9
  • http://stackoverflow.com/questions/8688002/error-with-cabal-mac-ossnow-leopard-ld-unknown-option-no-pie – Don Stewart May 23 '12 at 12:47
  • 1
    @DonStewart: There is no answer on that question and the comments don't help much. Plus, I think his problem is a little different than mine, because he is trying to install a package and I am just trying to compile a simple program. – Brandon oubiub May 23 '12 at 23:01
  • There we go. I had recently reinstalled an old backup of XCode, and thus an old ld. An update of XCode allowed my ld to accept the -no_pie flag. – Brandon oubiub May 24 '12 at 23:52

1 Answers1

1

Leopard got rid of no-pie for a period: http://trac.macports.org/ticket/34064

As the comments note, upgrading xcode/ld to more recent versions enables the flag.

sclv
  • 38,665
  • 7
  • 99
  • 204