Skip to content

Linking with ld/gold/rust-lld: unknown -z value: ,relro,-z,now #52634

Closed
@alecmocatta

Description

@alecmocatta

Compiling with an gcc/ld-like -C linker other than gcc/clang results in the -z,relro,-z,now argument not being recognised.

It seems gcc and clang accept the argument -Wl,-z,relro,-z,now where other ld-like linkers expect -z relro -z now.

working:

"-C linker=gcc"
"-C linker=clang"

not working:

"-C linker=ld -Z linker-flavor=ld"
ld: warning: -z ,relro,-z,now ignored.

"-C linker=gold -Z linker-flavor=ld"
gold: ,relro,-z,now: unknown -z option

"-C linker=rust-lld -Z linker-flavor=ld.lld"
rust-lld: error: unknown -z value: ,relro,-z,now

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