Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider emitting warnings for incompatible codegen and other command line options #71552

Closed
petrochenkov opened this issue Apr 25, 2020 · 3 comments
Labels
A-codegen Area: Code generation C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

petrochenkov commented Apr 25, 2020

cc #71490 (comment)

For example

  • -C relocation-model=ropi doesn't make sense outside of some embedded ARM targets
  • -C target-feature=+crt-static is silently ignored on most targets
  • -C target-feature=+crt-static is incompatible with -C relocation-model=pic on most targets and +crt-static silently wins (at link time)

Right now rustc behaves more like gcc which silently accepts conflicting options and produces something unspecified, than like clang which tries to produce warnings.
For example, in gcc -shared -pie -pie silently wins, but in clang -shared -pie -shared wins with a warning.

@petrochenkov
Copy link
Contributor Author

subscribe @Amanieu

@Elinvynia Elinvynia added A-codegen Area: Code generation C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 20, 2020
@petrochenkov
Copy link
Contributor Author

This issue is to general, but doesn't try to make specific sub-issues to organize the work.
@workingjubilee and @RalfJung are doing some work in a similar direction, but I don't think it makes sense to keep this issue open.

@RalfJung
Copy link
Member

FWIW I am only looking at options that cause soundness issues when used incorrectly, so the ones you mention here are not covered by that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants