llvm / llvm/Polygeist

Build error with shared libraries

Open
#275 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
624
Forks
170
PR merge metrics
No merged PRs in 30d

Description

Hello;
My LLVM is built with `shared_libs`. Now when I am trying to run `ninja check-cgeist`, I am getting error while linking. Can anyone please help me debug the error? Thanks a lot in advance. Here is the error I am seeing:

```
FAILED: lib/libMLIRPolygeist.so.16git
: && /usr/bin/g++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-z,defs -Wl,-z,nodelete -Wl,-z,defs -Wl,-z,nodelete -Wl,-rpath-link,/localdisk2/arnamoyb/sycl_workspace/llvm-temp/build/lib -Wl,--gc-sections -shared -Wl,-soname,libMLIRPolygeist.so.16git -o lib/libMLIRPolygeist.so.16git tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Dialect.cpp.o tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o -Wl,-rpath,"\$ORIGIN/../lib" lib/libMLIRMemRefDialect.so.16git lib/libMLIRArithmeticUtils.so.16git lib/libMLIRArithmeticDialect.so.16git lib/libMLIRInferIntRangeInterface.so.16git lib/libMLIRControlFlowInterfaces.so.16git lib/libMLIRDialect.so.16git lib/libMLIRDialectUtils.so.16git lib/libMLIRInferTypeOpInterface.so.16git lib/libMLIRSideEffectInterfaces.so.16git lib/libMLIRViewLikeInterface.so.16git lib/libMLIRIR.so.16git lib/libMLIRSupport.so.16git -lpthread lib/libLLVMSupport.so.16git lib/libLLVMCore.so.16git && :
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::rewrite(mlir::Operation*, mlir::PatternRewriter&) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM9MemmoveOpEE7rewriteEPNS_9OperationERNS_15PatternRewriterE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM9MemmoveOpEE7rewriteEPNS_9OperationERNS_15PatternRewriterE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::match(mlir::Operation*) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM8MemcpyOpEE5matchEPNS_9OperationE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM8MemcpyOpEE5matchEPNS_9OperationE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::match(mlir::Operation*) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM9MemmoveOpEE5matchEPNS_9OperationE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM9MemmoveOpEE5matchEPNS_9OperationE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::rewrite(mlir::Operation*, mlir::PatternRewriter&) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM8MemcpyOpEE7rewriteEPNS_9OperationERNS_15PatternRewriterE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM8MemcpyOpEE7rewriteEPNS_9OperationERNS_15PatternRewriterE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::match(mlir::Operation*) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM8MemsetOpEE5matchEPNS_9OperationE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM8MemsetOpEE5matchEPNS_9OperationE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::rewrite(mlir::Operation*, mlir::PatternRewriter&) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM8MemsetOpEE7rewriteEPNS_9OperationERNS_15PatternRewriterE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM8MemsetOpEE7rewriteEPNS_9OperationERNS_15PatternRewriterE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM8MemcpyOpEE15matchAndRewriteEPNS_9OperationERNS_15PatternRewriterE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM8MemcpyOpEE15matchAndRewriteEPNS_9OperationERNS_15PatternRewriterE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM9MemmoveOpEE15matchAndRewriteEPNS_9OperationERNS_15PatternRewriterE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM9MemmoveOpEE15matchAndRewriteEPNS_9OperationERNS_15PatternRewriterE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM8MemsetOpEE15matchAndRewriteEPNS_9OperationERNS_15PatternRewriterE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM8MemsetOpEE15matchAndRewriteEPNS_9OperationERNS_15PatternRewriterE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::rewrite(mlir::Operation*, mlir::PatternRewriter&) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_11AffineForOpEE7rewriteEPNS_9OperationERNS_15PatternRewriterE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_11AffineForOpEE7rewriteEPNS_9OperationERNS_15PatternRewriterE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::match(mlir::Operation*) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_11AffineForOpEE5matchEPNS_9OperationE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_11AffineForOpEE5matchEPNS_9OperationE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::rewrite(mlir::Operation*, mlir::PatternRewriter&) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM6LoadOpEE7rewriteEPNS_9OperationERNS_15PatternRewriterE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM6LoadOpEE7rewriteEPNS_9OperationERNS_15PatternRewriterE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::match(mlir::Operation*) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM6LoadOpEE5matchEPNS_9OperationE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM6LoadOpEE5matchEPNS_9OperationE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_11AffineForOpEE15matchAndRewriteEPNS_9OperationERNS_15PatternRewriterE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_11AffineForOpEE15matchAndRewriteEPNS_9OperationERNS_15PatternRewriterE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM6LoadOpEE15matchAndRewriteEPNS_9OperationERNS_15PatternRewriterE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_4LLVM6LoadOpEE15matchAndRewriteEPNS_9OperationERNS_15PatternRewriterE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::rewrite(mlir::Operation*, mlir::PatternRewriter&) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_3scf5ForOpEE7rewriteEPNS_9OperationERNS_15PatternRewriterE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_3scf5ForOpEE7rewriteEPNS_9OperationERNS_15PatternRewriterE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o: In function `mlir::detail::OpOrInterfaceRewritePatternBase::match(mlir::Operation*) const':
Ops.cpp:(.text._ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_3scf5ForOpEE5matchEPNS_9OperationE[_ZNK4mlir6detail31OpOrInterfaceRewritePatternBaseINS_3scf5ForOpEE5matchEPNS_9OperationE]+0x1c): undefined reference to `mlir::detail::TypeIDResolver::id'
...
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing `ninja check-cgeist` with LLVM built using shared libraries and inspect the link step for `lib/libMLIRPolygeist.so.16git`. Trace the undefined `TypeIDResolver` references from `tools/polygeist/lib/polygeist/CMakeFiles/obj.MLIRPolygeist.dir/Ops.cpp.o`; done means the target links successfully in this configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.