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

Add -fhardened to Compiler Options Hardening Guide #492

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thomasnyman
Copy link
Contributor

Adds `-fhardened introduced in GCC 14 to Compiler Options Hardening Guide.

Fixes #240

Signed-off-by: Thomas Nyman <thomas.nyman@ericsson.com>
@thomasnyman
Copy link
Contributor Author

Commit 0197398 fixes version information to be consistent with #507.


### Additional Considerations

Options explicitly specified on the compiler command line always take precedence, e.g., `-fhardened -fstack-protector` will enable `-fstack-protector`, not `-fstack-protector-strong` implied by `-fhardened`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's -Whardened, which should warn if a flag ends up downgrading or disabling hardening enabled by -fhardened. It should get enabled whenever -fhardened is specified.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's a very useful addition. I'll add it to the table in this section as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler Hardening Guide should recommend -fhardened option
2 participants