Skip to content

-C rpath generates bad options for paths with commas #38795

Closed
@jsgf

Description

@jsgf

-C rpath generates linker options of the form -Wl,-rpath,<path>. This fails if <path> contains commas, because -Wl, separates options on commas, so the linker ends up getting a bad path and spurious extra parameters.

The solution is to use -Xlinker which passes the next option through literally, so the full rpath can be specified with -Wl,-rpath -Xlinker <path,with,commas>. The -Xlinker form is fairly verbose, and only needed when there are commas.

(This comes up when building with Buck, because it generates paths of the form base/path/file.o#flavor1,flavor2 where "flavors" are things like "shared", "static", "pic", etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions