Skip to content

[mlir] ODR violation in Pass.h #141404

Open
Open
@imwints

Description

@imwints

Downstream bug report https://bugs.gentoo.org/956603

/dev/shm/portage/llvm-core/mlir-21.0.0_pre20250523/work/mlir/include/mlir/Pass/Pass.h:400:7: error: virtual table of type ‘struct OperationPass’ violates one definition rule [-Werror=odr]
  400 | class OperationPass<void> : public Pass {
      |       ^
/dev/shm/portage/llvm-core/mlir-21.0.0_pre20250523/work/mlir/include/mlir/Pass/Pass.h:400:7: note: the conflicting type defined in another translation unit
  400 | class OperationPass<void> : public Pass {
      |       ^
/dev/shm/portage/llvm-core/mlir-21.0.0_pre20250523/work/mlir/include/mlir/Pass/Pass.h:189:25: note: virtual method ‘initialize’
  189 |   virtual LogicalResult initialize(MLIRContext *context) { return success(); }
      |                         ^
<built-in>: note: ought to match virtual method ‘__cxa_pure_virtual’ but does not
lto1: some warnings being treated as errors
lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

According to https://wiki.gentoo.org/wiki/LTO we should enable -Werror=odr to detect possible runtime issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions