-
Notifications
You must be signed in to change notification settings - Fork 74
Lint unsupported, target-specifc codegen flags #957
Copy link
Copy link
Closed
Labels
T-compilerAdd this label so rfcbot knows to poll the compiler teamAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustcA proposal to make a major change to rustcmajor-change-acceptedA major change proposal that was acceptedA major change proposal that was accepted
Metadata
Metadata
Assignees
Labels
T-compilerAdd this label so rfcbot knows to poll the compiler teamAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustcA proposal to make a major change to rustcmajor-change-acceptedA major change proposal that was acceptedA major change proposal that was accepted
Type
Fields
Give feedbackNo fields configured for issues without a type.
Proposal
Some rustc codegen flags are target specific (or specific to families of targets) and have no effect when used on unsupported targets. For example:
-C control-flow-guard- Only supported on Windows targets-C dlltool- Only used on*-windows-gnutargets-C dwarf-version- Has no effect on*-windows-msvctargets-C relro-level- Has no effect on*-windows-msvctargetsThe question of "what should a codegen flag do on unsupported targets" has previously come up during stabilization of some codegen flags.
I propose that we add a lint which fires when a codegen flag is passed to the compiler which is ignored for the active target:
The lint should default to the
warnlevel but users can choose todenyorallowit via-Dor-Aflags respectively. Ideally the lint would only flag attempts to activate unsupported options as to avoid unnecessary diagnostic noise (egrustc -C control-flow-guard=off --target x86_64-unknown-linux-gnu ...would not trigger the lint).Mentors or Reviewers
I'm willing to mentor or implement the proposal.
Process
The main points of the Major Change Process are as follows:
@rustbot secondor kickoff a team FCP with@rfcbot fcp $RESOLUTION.You can read more about Major Change Proposals on forge.