Skip to content

WARN rustc_codegen_ssa::back::link Linker does not support -static-pie command line option #109855

Closed
@iquanxin

Description

@iquanxin

Why does this warning appear? How should I remove it?

Code

fn main() {
    println!("Hello, world!");
}

Meta

rustc --version --verbose:

rustc 1.68.2 (9eb3afe9e 2023-03-27)
binary: rustc
commit-hash: 9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0
commit-date: 2023-03-27
host: x86_64-unknown-linux-gnu
release: 1.68.2
LLVM version: 15.0.6

Error output

[root@7700K less1]# cargo build --target=x86_64-unknown-linux-musl && file target/x86_64-unknown-linux-musl/release/less1 && target/x86_64-unknown-linux-musl/release/less1
WARN rustc_codegen_ssa::back::link Linker does not support -static-pie command line option. Retrying with -static instead.
    Finished dev [unoptimized + debuginfo] target(s) in 0.00s
target/x86_64-unknown-linux-musl/release/less1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=cbe92f394971a715cab10ab360b28e03bfaa825e, not stripped
Hello, world!
[root@7700K less1]#
Backtrace

<backtrace>

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-discussionCategory: Discussion or questions that doesn't represent real issues.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions