<div dir="ltr">are you using GCC or Clang, what versions are they?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 10, 2013 at 4:43 PM, Alexander Pakhomov <span dir="ltr"><<a href="mailto:ker0sin@yandex.ru" target="_blank">ker0sin@yandex.ru</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks. I think preprocessor dump could help me:<br>
cpp -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -Irts/dist/build -Irts/dist/build/autogen         rts/HeapStackCheck.cmm > cpp_dump<br>


That is ghc-stage1 -> cpp and all options that cpp doesn't accept removed.<br>
I hope ghc preprocessor is compatible with system C preprocessor.<br>
<br>
11.12.2013, 01:06, "Simon Marlow" <<a href="mailto:marlowsd@gmail.com">marlowsd@gmail.com</a>>:<br>
<div class="HOEnZb"><div class="h5">> On 10/12/13 00:35, Alexander Pakhomov wrote:<br>
><br>
>>  Hi. Trying to compile ghc HEAD on OpenBSD I got an error:<br>
>>  rts/HeapStackCheck.cmm:97:18: parse error on input `['<br>
>>  The code is following:<br>
>>    96         if (HpAlloc <= BLOCK_SIZE<br>
>>    97             && bdescr_link(CurrentNursery) != NULL) {<br>
>>  which preprocesses to:<br>
>>           if (HpAlloc <= (1<<12)<br>
>>               && b0[CurrentNursery+15] != (0::bits64)) {<br>
>>  This is the first occurrence of b0 in preprocessed file. I believe that it is due to undefined b0.<br>
>>  Command that fails is:<br>
>>  "inplace/bin/ghc-stage1" -static  -H32m -O -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -package-name rts -dcmm-lint      -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen           -O2    -c rts/HeapStackCheck.cmm -o rts/dist/build/HeapStackCheck.o<br>


>>  To preprocess do the following:<br>
>>  cpp -O -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -Irts/dist/build -Irts/dist/build/autogen         rts/HeapStackCheck.cmm | less<br>


>><br>
>>  Can you please find source of b0 in preprocessed file?<br>
><br>
> I think this means that something went wrong when generating<br>
> DerivedConstants.h, which is where the definition of bdescr_link() comes<br>
> from.  In my build, I have the following, in the file<br>
> includes/dist-derivedconstants/header/:<br>
><br>
> #define OFFSET_bdescr_link 16<br>
> #define REP_bdescr_link b64<br>
> #define bdescr_link(__ptr__) REP_bdescr_link[__ptr__+OFFSET_bdescr_link]<br>
><br>
> This is auto-generated by the program in utils/deriveConstants.  This<br>
> used to be a C program, but nowadays it's a Haskell program that<br>
> generates a C program for reasons that I forget.  Anyway, your problem<br>
> is somewhere in there... see if you can find out where by dumping out<br>
> intermediate files and so forth.  If you get stuck, tell us where you<br>
> get to and we'll try to help some more.<br>
><br>
> Cheers,<br>
> Simon<br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br>
</div></div></blockquote></div><br></div>