GCC, Mac OS X & the future

Dan Knapp dankna at gmail.com
Fri Jul 1 18:27:35 CEST 2011


  First off, thanks for the help with git, I appreciate that.

> I think the important cases to distinguish are:
>
> 1. Does the C compiler us an LLVM backend (e.g. llvm-gcc or clang)
> 2. Is the C compiler clang?
>
> For #1 we know that we have to write some different code in the rts to handle thread local storage. For #2 we know that we have to use a different C preprocessor (and perhaps write some of the rts C code differently?).
>
> For #1, I defined the preprocessor variable llvm_CC_FLAVOR based on whether or not the C compiler defines the __llvm__ preprocessor variable, which both llvm-gcc and clang do. For #2 it could be done by looking for the __clang__ preprocessor variable.

  Excellent point.  Okay.  I hadn't thought about supporting llvm-gcc
at this juncture, but there's no reason I can't modify my build-system
stuff to handle all three possibilities so that at least people can
try it.  I'll make it so there are two separate preprocessor variables
for the two conditions.

> I'm not that familiar with the C preprocessor, but I didn't think it was easy to compare strings in #if directives. If you define CC_FLAVOR as a string, is there an easy way to do the conditional compilation we need in the rts?

  You are correct, there's not.  I hadn't thought that through.  Okay,
I'll go ahead and modify my stuff accordingly.

-- 
Dan Knapp
"An infallible method of conciliating a tiger is to allow oneself to
be devoured." (Konrad Adenauer)



More information about the Cvs-ghc mailing list