Skip to content

Retpoline support in rustc (target features or dedicated flags) #116852

Open
@ojeda

Description

@ojeda
Contributor

Currently:

-Ctarget-feature="+retpoline-external-thunk"
-Ctarget-feature="+retpoline-indirect-branches"
-Ctarget-feature="+retpoline-indirect-calls"

seems to work as expected, but the features are unknown, and so since 1.61 they emit a warning:

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

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

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

Could/should these be added as known features to avoid using the target specification file?

In an old issue at #54637 it seems that back then dedicated flags were not intended (like Clang's -mretpoline-external-thunk and GCC's -mindirect-branch=thunk-extern -mindirect-branch-register), which perhaps make a bit more sense.

MCP: rust-lang/compiler-team#868

Activity

added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Oct 17, 2023
added
A-codegenArea: Code generation
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Oct 17, 2023

26 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationC-feature-requestCategory: A feature request, i.e: not implemented / a PR.PG-exploit-mitigationsProject group: Exploit mitigationsT-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

        Participants

        @RalfJung@Darksonn@ojeda@rustbot@Noratrieb

        Issue actions

          Retpoline support in `rustc` (target features or dedicated flags) · Issue #116852 · rust-lang/rust