<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LLVM 12: Unresolved symbols in LLVM-C OrcJIT V2"
   href="https://bugs.llvm.org/show_bug.cgi?id=49745">49745</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVM 12: Unresolved symbols in LLVM-C OrcJIT V2
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>me@supergrecko.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>There appear to be two typos in the new LLVM-C bindings for OrcJIT V2 resulting
in unresolved symbols upon linking because the definitions in
lib/ExecutionEngine/Orc/OrcV2CBindings.cpp do not match the header file
include/llvm-c/Orc.h.

The symbols in question are LLVMOrcExecutionSessionGetJITDylibByName and
LLVMOrcDisposeObjectLayer.

Both reproduction examples are built with clang version 10.0.0-4ubuntu1
linux-x86_64 and ld 2.34, where $LLVM_CONFIG is the path to the llvm-config
executable in the build directory.

Builds are from trunk, commit c769ba9514c3, but any builds after
f35707047e216e99052c15b04fe508d075b6121b is capable of reproducing



## LLVMOrcExecutionSessionGetJITDylibByName

In the header file the first parameter, an LLVMOrcExecutionSessionRef is
missing. This means that the library won't link if the symbol is used.

Reproduce with the following source file and command line.

clang++ orcjit-bug-1.cc -o orcjit-bug-1 \
    -I `$LLVM_CONFIG --includedir --ldflags --libfiles all` \
    -ldl -lpthread -lz -lcurses

---
#include "llvm-c/Orc.h"

int main() {
    const char *P = "not-relevant-to-reproduce";

    LLVMOrcExecutionSessionGetJITDylibByName(P);
}
---



## LLVMOrcDisposeObjectLayer

The definition of this symbol in the C++ source file has misspelled the symbol
name with a tiny l in LLVM, lLVMOrcDisposeObjectLayer instead of
LLVMOrcDisposeObjectLayer.

clang++ orcjit-bug-2.cc -o orcjit-bug-2 \
    -I `$LLVM_CONFIG --includedir --ldflags --libfiles all` \
    -ldl -lpthread -lz -lcurses

---
#include "llvm-c/Orc.h"

int main() {
    LLVMOrcObjectLayerRef *Layer = new LLVMOrcObjectLayerRef;
    LLVMOrcDisposeObjectLayer(*Layer);
}
---



I'm new to contributing to LLVM so I would like to work on fixing these bugs to
become more familiar with the project if that's possible. It's also my first
time submitting a bug report here so let me know if anything is missing!</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>