Skip to content

supporting other linkers #1

Open
@japaric

Description

Unresolved questions

1. How to expose this feature?

Maybe a command line interface that looks like this:

flip-link $actual_linker_arguments --linker=arm-none-eabi-gcc 

Where --linker may appear in any position. flip-link will use arm-none-eabi-gcc as the linker.

This way the user species flip-link in their config.toml like this:

# .cargo/config.toml
rustflags = [
    "-C", "linker=flip-link",
    "-C", "link-arg=--linker=arm-none-eabi-gcc", # <- may appear in any position
    "-C", "linker-flavor=gcc", # <- not passed to the linker
    # ..
]

2. How to determine the linker flavor?

flip-link passes extra linker arguments to the underlying linker.
It currently assumes the linker flavor is "ld". If you want to use gcc those extra linker arguments need to be prefixed by -Wl, (iirc), i.e. -Wl,--defsym=something instead of just --defsym=something.
flip-link will not see the -C linker-flavor passed to rustc. Should the user also pass a --linker-flavor argument to flip-link?

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions