Skip to content

RISC-V LLVM feature +relax not recognized by rustc #109426

Closed
@zyedidia

Description

@zyedidia

Code

// Compile with: rustc --target riscv64imac-unknown-none-elf -C target-feature=+relax test.rs --emit=obj

#![no_std]
#![no_main]

use core::panic::PanicInfo;

#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
    loop {}
}

Current output

warning: unknown feature specified for `-Ctarget-feature`: `relax`
  |
  = note: it is still passed through to the codegen backend
  = help: consider filing a feature request

warning: 1 warning emitted

Desired output

No warning.

Rationale and extra context

I would like to enable linker relaxation for the RISC-V target. To do so I passed -C target-feature=+relax to tell LLVM to use linker relaxation. It seems like rustc is not aware of this option, so it emits a warning (but the feature is still properly enabled). I can't find any way to disable this warning, so I am submitting this issue in the hopes that either the feature will become recognized, or a way to disable the warning will be added.

Related: #96472.

The program is compiled by running rustc --target riscv64imac-unknown-none-elf -C target-feature=+relax test.rs --emit=obj

Hopefully I've posted this to the correct place. Thanks!

Other cases

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-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