<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Just to circle back here, I did a bit
      more digging.  I'm not entirely sure how this is supposed to work
      - our linking scheme is a bit of a mess - but here would be the
      two things I'd try.<br>
      <br>
      Explicitly include:<br>
      #include "llvm/CodeGen/LinkAllCodegenComponents.h"<br>
      <br>
      Call the functions:<br>
      initializeCore(*Registry);<br>
      initializeCodeGen(*Registry); <br>
      <br>
      What I think is happening is that you're getting into the
      GCStrategy code without having run the initializers for the
      CodeGen library.  Not entirely sure how that's possible, but it
      appears to be the best explanation for the symptoms.  <br>
      <br>
      Philip<br>
      <br>
      On 04/02/2015 10:45 AM, Mukul Sabharwal wrote:<br>
    </div>
    <blockquote
cite="mid:CAC6EoorgEFgMa-jANYo91cye9NMMY4HfN7Ha2TgS2yb5HG4CCQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>There is a review out, that exposes llvm::linkShadowStackGC
          to the C bindings.</div>
        <div><br>
        </div>
        <div><a moz-do-not-send="true"
            href="http://reviews.llvm.org/D8788">http://reviews.llvm.org/D8788</a></div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Apr 1, 2015 at 10:48 AM, Hayden
          Livingston <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:halivingston@gmail.com" target="_blank">halivingston@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">This is also happening when using the C++
              APIs. It looks like an MCJIT and SetGC interaction.
              <div><br>
              </div>
              <div>I'm lost on how to proceed further.</div>
            </div>
            <div class="HOEnZb">
              <div class="h5">
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">On Tue, Mar 31, 2015 at 10:42
                    PM, Hayden Livingston <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:halivingston@gmail.com"
                        target="_blank">halivingston@gmail.com</a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div dir="ltr">
                        <div>The erlang was a typo, I was trying things
                          out.</div>
                        <div><br>
                        </div>
                        <div>I've updated the bug with a C program,
                          which exhibits the problem.</div>
                        <div><br>
                        </div>
                        <div>To answer your question, given the IR you
                          generated llc/opt does not complain.</div>
                      </div>
                      <div>
                        <div>
                          <div class="gmail_extra"><br>
                            <div class="gmail_quote">On Tue, Mar 31,
                              2015 at 9:59 PM, Philip Reames <span
                                dir="ltr"><<a moz-do-not-send="true"
href="mailto:listmail@philipreames.com" target="_blank">listmail@philipreames.com</a>></span>
                              wrote:<br>
                              <blockquote class="gmail_quote"
                                style="margin:0 0 0 .8ex;border-left:1px
                                #ccc solid;padding-left:1ex">
                                <div text="#000000" bgcolor="#FFFFFF"><span>
                                    <div>On 03/31/2015 09:52 PM, Philip
                                      Reames wrote:<br>
                                    </div>
                                    <blockquote type="cite"> <br>
                                      <blockquote type="cite">
                                        <div dir="ltr">
                                          <div>Maybe it is because I'm
                                            using a package that makes
                                            an LLVM DLL for Windows.</div>
                                          <div><br>
                                          </div>
                                          <div>The only reason why it
                                            show that error is if the
                                            static constructor for it
                                            didn't run, right? And I
                                            don't know why it would not
                                            run.</div>
                                        </div>
                                      </blockquote>
                                      I need to take a closer look at
                                      your bug report before I can
                                      really comment.  </blockquote>
                                  </span> Ok, I took a look.  Its hard
                                  for me to tell much from your report. 
                                  I don't have Visual Studios (or
                                  Windows for that matter) and can't
                                  easily reproduce.  <br>
                                  <br>
                                  It would really help to know if this
                                  is a problem with the C bindings or
                                  the generated IR.  If you manually
                                  create the expected IR and run it
                                  through opt/llc, does that work?<br>
                                  <br>
                                  Can you include the full output of
                                  this example?  Both the IR and the
                                  error would be useful to see.  <br>
                                  <br>
                                  One observation, it looks like you're
                                  using the erlang GC not shadow stack? 
                                  e.g. <br>
                                  LLVM.SetGC(sum, "erlang");<br>
                                  <br>
                                  Philip<br>
                                  <br>
                                </div>
                              </blockquote>
                            </div>
                            <br>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            LLVM Developers mailing list<br>
            <a moz-do-not-send="true" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> 
                   <a moz-do-not-send="true"
              href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
            <a moz-do-not-send="true"
              href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"
              target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>