On 30/05/2011 14:59, Manuel M T Chakravarty wrote:
It is no secret that Apple moves away from the traditional GCC
backend to LLVM. In fact, Xcode (which bundles all command line
developer tools on the Mac) today comes with two flavours of gcc:
'gcc' and 'llvm-gcc', which AFAIK only differ in the backend that is
being used. Currently, the default is the traditional GCC backend,
but it takes no precognition to realise that this will eventually
change. The 'gcc' executable will use the LLVM backend and, at least
for a while, the traditional backend will still be available under a
different name.
Unfortunately, GHC will break at this point as the LLVM backend does
not support pinned global registers. ('llvm-gcc' happily accepts the
register assignment, but fails with a runtime error during code
generation.)
This shouldn't be a problem. We don't use pinned global registers any
more, except in one place - the GC (see rts/sm/GCTDecl.h). There it's
optional, but you lose a bit of performance by not using a pinned
register. It's not a huge deal.
Have you tried building GHC with llvm-gcc? I think I tried it on the
RTS a year or so ago to check the LLVM output against gcc (LLVM wasn't
quite as good at the time).
> Now, it shouldn't be hard to make configure a bit
smarter to ensure it picks a version of gcc with the old backend
(after all, --version is sufficient to identify the backend).
However, GHC bakes the pathname of gcc into various places during a
build. Hence, a GHC built with todays Xcode will not run on a Mac
using a future version that uses the LLVM backend by default. This
then gives the same awkward user experience as when Xcode 4 was
released and GHC broke.
To avoid that, we would need to pick the right version of gcc to use
at GHC install time instead. Does that make sense? I wonder how
many places are referring to gcc in an install.
Any gcc should be fine, unless I've missed something?
Cheers,
Simon
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc