Skip to content

[lld] LLVM successful link depends on static libraries order #116669

@MarkaPola

Description

@MarkaPola

CMake 3.31.0 extend the deduplication of static libraries to new environments.

Unfortunately, the version 3.31.0 introduce an unwanted side-effect regarding lld usage which reveal a problem with lld in case of ELF binary format: if static libraries are deduplicated, the success or failure of the build of LLVM depends on the order of the static libraries. For other binary format (COFF, Mach-O) the link is successful regardless the order of static libraries.
Unfortunately, I was unable to reproduce this problem on a simple example.

The full history of this problem can be consulted on the CMake-26447 issue.

FYI, CMake version 3.31.1 will suppress this side effect, but users of lld will potentially be confronted to this bug if static libraries deduplication is active.

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