<div dir="ltr">On Sat, Jun 13, 2015 at 9:44 AM, Zhen Zhang <span dir="ltr"><<a href="mailto:izgzhen@gmail.com" target="_blank">izgzhen@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi everyone,<div><br></div><div>I am having trouble porting some 6.8.2 GHC code to 7.8.3 GHC. The main trouble I met is that, in 6.8.2, there is a <span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:32px;background-color:rgb(247,247,247)">includes/mkDerivedConstants.c</span> and some constants about RTS are declared here.</div><div><br></div><div>While in 7.8.3, there is only a similar  `includes/dist-derivedconstants/header` directory containing a bunch of code. Some seems generated like `DerivedConstants.h`, and it seems like `tmp.c` generated this.</div><div><br></div><div>However, when I added some entries in `tmp.c` and compiled it, then it became the original version ... So I doubted that if there is another file which is equivalent to the <span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:32px;background-color:rgb(247,247,247)">includes/mkDerivedConstants.c </span>in 6.8.2?</div></div></blockquote><div><br></div><div>Hi Zhen,<br><br></div><div>Take a look at utils/deriveConstants/DeriveConstants.hs. That program generates tmp.c, then compiles it with the C compiler and inspects the sizes of symbols in the resulting object file and writes the information it gathered to DerivedConstants.h. We do it this way now to support cross-compilation (in that case, the C compiler generates object files for the target platform so we can't simply run them on the system that is building GHC).<br><br></div><div>Regards,<br></div><div>Reid Barton<br></div></div></div></div>