Skip to content

eld should be reporting its own name/info in --version output #138

Closed

Description

Currently, eld's --version doesn't actually output anything saying that it is eld. Currently it looks something like below:

$ ld.eld --version
Supported Targets: arm aarch64 riscv x86_64
Linker from <vendor name> Version 21.0.0
Linker based on LLVM version: 21.0
Linker Plugin Support Enabled
Linker Plugin Interface Version 4.0
LTO Support Enabled

I think this is a problem as parsing --version output in build systems to detect the tool in use seems to be a fairly common occurrence and, in eld's case, there isn't anything particularly obvious to parse against. Especially worrying about this is that people might grab vendor specific information to detect a "generic" eld--see meson for example where I think this has happened already: https://github.com/mesonbuild/meson/blob/4a57a5fd0cdd5064a03566f40b61c827f27ea529/mesonbuild/linkers/detect.py#L169-L171

Granted, people could check against something like "Linker" and "LLVM", but given that these are so generic I don't think that's a great direction to steer people. I think it makes most sense to just to report "eld" or "ELD" somewhere in the --version output to give something clear to parse.

Activity

  1. quic-seaswara commented on Jun 9, 2025

    @quic-seaswara
    Contributor

    i agree having eld in the version output will allow scripts to parse that the linker being used is eld.

  2. jonathonpenix commented on Jun 9, 2025

    @jonathonpenix
    ContributorAuthor

    I think this might have come up in the past, but would it be worth also establishing an eld-specific version while we're here? Or should build systems be looking at the associated LLVM version?

  3. quic-seaswara commented on Jun 9, 2025

    @quic-seaswara
    Contributor
    ld.eld --version
    eld 21.0.0 (GNU compatible linker)
    Supported Targets: arm aarch64 riscv x86_64
    

    How does this sound ?

  4. jonathonpenix commented on Jun 9, 2025

    @jonathonpenix
    ContributorAuthor

    Seems reasonable to me. FWIW, I don't mind the extra Linker from <vendor name> Version 21.0.0 \ Linker based on LLVM version: 21.0 \ Linker Plugin Support Enabled \ Linker Plugin Interface Version 4.0 \ LTO Support Enabled info being present if the eld <version> (GNU compatible linker) is first

  5. quic-seaswara commented on Jun 9, 2025

    @quic-seaswara
    Contributor

    I will add an --about or --info option if we want more details about the linker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions