Skip to content

[lld][coff] spurious duplicate symbols with delayload on x86 #107371

Open
@glandium

Description

@glandium

STR:

Expected result: success

Actual result:

lld-link: error: duplicate symbol: __declspec(dllimport) __load_timeBeginPeriod
lld-link: error: duplicate symbol: __declspec(dllimport) __load_timeEndPeriod
lld-link: error: duplicate symbol: __declspec(dllimport) __load_CoInitializeEx
lld-link: error: duplicate symbol: __declspec(dllimport) __load_GetClientRect

Removing -DELAYLOAD:ole32.dll, -DELAYLOAD:user32.dll, and -DELAYLOAD:winmm.dll from the response file makes the issue go away.

What's peculiar in this link is that there are COFF import files in gkrust.lib that repeats symbols from other .libs. Those come from rust's raw-dylib feature. It somehow makes the linker trip with the delayload, but only on x86, not x86_64 or aarch64.

Cc: @mstorsjo

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