On Jul 1, 2011, at 10:10 AM, Dan Knapp wrote:
> Thank you for doing this work! I'm going to take some time over the
> weekend and integrate it into my own work on the build system.
Great!
> I'll fix/replace your autoconf patch to integrate with what I've already
> done - I did the work to produce a preprocessor variable CC_FLAVOR
> defined as "gcc" or "clang", depending on what we were configured
> against, which is a better way to get the information.
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.
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?
> A note - one reason my build-system work hasn't seen the light of day
> is that git mystifies me. Is the preferred way of submitting my work
> that I should put my copy of the repo someplace publicly visible and
> post a link to it on this mailing list, as you have done? I couldn't
> figure out how to get git to generate an email encapsulating the
> patch...
I'm not sure what the preferred way is, but for larger changes I usually put it
on github to make it easier for someone to browse around if they want. You can
send patches using git format-patch. Something like
$ git clone <ghc git repo>
... make your changes ...
$ git format-patch origin/master
The format-patch will generate a patch file for each commit since the one given
on the command line (origin/master in this case). You can then attach those
files to an email.
-David
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc