[llvm-bugs] [Bug 49843] New: 43ceb74eb1a broke static LLVM extensions (e.g. Polly)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 5 08:55:17 PDT 2021


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

            Bug ID: 49843
           Summary: 43ceb74eb1a broke static LLVM extensions (e.g. Polly)
           Product: Build scripts
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: CONFIRMED
          Severity: release blocker
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: raul at tambre.ee
                CC: llvm-bugs at lists.llvm.org, tstellar at redhat.com

cmake ../llvm -GNinja \
        -DLLVM_BUILD_LLVM_DYLIB=ON \
        -DLLVM_ENABLE_PROJECTS="polly" \
        -DLLVM_TARGETS_TO_BUILD="X86"
ninja lib/libLLVM-13git.so

Fails with:
[1468/1468] Linking CXX shared library lib/libLLVM-13git.so
FAILED: lib/libLLVM-13git.so
[build command redacted as it's very long]
ld.lld: error: undefined symbol: getPollyPluginInfo()
>>> referenced by Extension.def:2 (include/llvm/Support/Extension.def:2)
>>>               lib/Extensions/CMakeFiles/obj.LLVMExtensions.dir/Extensions.cpp.o:(llvm::details::extensions_anchor())
>>> referenced by Extension.def:2 (include/llvm/Support/Extension.def:2)
>>>               lib/LTO/CMakeFiles/obj.LLVMLTO.dir/LTOBackend.cpp.o:(RegisterPassPlugins(llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, llvm::PassBuilder&))

I've bisected this to commit 43ceb74eb1a5801662419fb66a6bf0d5414f1ec5.

Observations:
* Reverting the change in llvm/tools/llvm-shlib/CMakeLists.txt bypasses the
issue.
* Passing -DLLVM_POLLY_LINK_INTO_TOOLS=OFF works around the issue.

I've added some debug prints and confirmed that obj.Polly target is being
created.
Dependency on Polly if it's static seems to be added in
function(process_llvm_pass_plugins) to LLVMExtensions's LINK_LIBRARIES through
LLVM_STATIC_EXTENSIONS.

I think the issue might be something to do with the fact if libLLVM is linked
against obj.LLVMExtensions it doesn't pull in Polly as no linking happens for
object libraries. But I'm not sure, as this is fairly complicated.

Cc @tstellar in case you don't mind fixing this.

-- 
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/20210405/6091c174/attachment.html>


More information about the llvm-bugs mailing list