Skip to content

LLVM ld64.lld #85938

@tschuett

Description

@tschuett

I tried to use the new MachO linker from LLVM:

RUSTFLAGS="-C linker=/Users/tschuett/modules/clang/git/bin/ld64.lld" cargo build

  = note: ld64.lld:
          ld64.lld: error: unknown argument '-Wl,-dead_strip'
          ld64.lld: error: must specify -platform_version

First issue, rust appends -Wl, which makes the linker unhappy. Dead stripping is supported since today (https://reviews.llvm.org/D103324).

Second issue the linker requires a platform version:
https://github.com/llvm/llvm-project/blob/06e047227d71b2c1c477e280172abed0f1eed2c8/lld/MachO/Driver.cpp#L598

platform_version was introduced into clang:
https://reviews.llvm.org/D71579

Did the LinkerFlavor detection fail?

#39915

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions