[llvm-bugs] [Bug 49745] New: LLVM 12: Unresolved symbols in LLVM-C OrcJIT V2

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Mar 27 13:48:22 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=49745

            Bug ID: 49745
           Summary: LLVM 12: Unresolved symbols in LLVM-C OrcJIT V2
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: me at supergrecko.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

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!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210327/0c1058fd/attachment.html>


More information about the llvm-bugs mailing list