Skip to content

Duplicate symbol when linking against llvm@11 on macOS 11 #222

Closed
@ColMcp

Description

@ColMcp

I got this error when linking my example compiler against LLVMSwift and llvm@11 on my macOS 11 system:

duplicate symbol '_LLVMAddInternalizePassWithMustPreservePredicate' in:
    /Users/.../Local/Swift/tigon/.build/x86_64-apple-macosx/debug/llvmshims.build/src/shim.cpp.o
    /usr/local/Cellar/llvm/11.0.0_1/lib/libLLVMipo.a(IPO.cpp.o)

(Note: to try this I had to change LLVMSwift's Package.swift platforms attribute to .macOS(.v11))

I got round the duplicate symbol by commenting out the declaration and definition of LLVMAddInternalizePassWithMustPreservePredicate in shim.cpp. The resulting executable ran a minimal test OK.

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