<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, May 11, 2017 at 11:18 PM Boris Kolpackov <<a href="mailto:boris@codesynthesis.com">boris@codesynthesis.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi David,<br>
<br>
David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> writes:<br>
<br>
>   -Xclang -fmodules-codegen<br>
>   -Xclang -fmodules-debuginfo<br>
><br>
> [...]<br>
><br>
> It should work naturally either way, I think.<br>
<br>
Yep, all works now, thanks.<br>
<br>
Somewhat related question: what happens if I pass -fPIC? I assume I<br>
will need different .o for PIC/non-PIC. Will I also need different<br>
.pcm files?<br>
<br>
I tend to think the answer is yes since at the minimum -fPIC may<br>
define preprocessor macros that may change the translation unit.<br></blockquote><div><br>If a flag changes things like preprocessor macros then it would need to be consistently passed to all stages (including the first one - that generates the .pcm). I know Clang has some enforcement of matching flags between PCM generation steps and uses (& hopefully that also triggers on the PCM->Object step too, though I haven't checked).<br><br>I'm not sure how lenient those checks are (whether they have many false positives (flagging mismatched flags that are benign/can be composed without conflicting) or false negatives (allowing mismatched flags that are incompatible))<br><br>Richard might be able to say more about that.<br><br>I think -O flags also generate preprocessor defines, so I expect they would be checked/enforced by this too, and not possible to use a PCM built with a different -O level than its use.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I guess what I am trying to understand is if .pcm is just the AST<br>
or if it actually includes some object/intermediate code? For example,<br>
does it make sense to pass -O when generating .pcm? Sorry if these<br>
are stupid/obvious questions ;-).<br>
<br>
<br>
Thanks,<br>
Boris<br>
</blockquote></div></div>