Skip to content

rustbuild: rustc's -Crpath does not work #32886

Closed
@alexcrichton

Description

@alexcrichton

The way the compiler emits rpath directives is relative to the output directory structure, but with rustbuild we output in one structure and then copy over into another. This means that -Crpath basically doesn't work, and things like LD_LIBRARY_PATH need to be specified manually.

This is a pretty tricky bug to fix as it will involve something like:

  • Glorious hacks in the src/bootstrap/rustc.rs script to manually pass rpath directives
  • Modifying the -C rpath argument to take some sort of value indicating what should be passed to the linker, this is an API change to the compiler, however.
  • Use some sort of tool to modify this metadata in the executable after it's generated

I'm somewhat leaning towards the "glorious hacks" method for now to get something working and avoid changing the compiler, but there are other reasons why we would want to modify the -C rpath argument to the compiler as well perhaps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions