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 -D_FORTIFY_SOURCE=3 to CFLAGS if supported #192

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

Conversation

royhills
Copy link
Owner

@royhills royhills commented Aug 26, 2024

Currently we check for -D_FORTIFY_SOURCE=2 support using GCC version checks. Update this to use -D_FORTIFY_SOURCE=3 if supported by the toolchain.

Don't use ax_add_fortify_source.m4 from the autoconf archive as originally planned because this macro leaves the setting unchanged if it has been configured in the compiler settings.

This change will add -D_FORTIFY_SOURCE=3 to CFLAGS if supported (recent GCC and Clang versions) and, failing that, add -D_FORTIFY_SOURCE=2 which will almost certainly be supported.

@coveralls
Copy link

Coverage Status

coverage: 91.302%. remained the same
when pulling 1bfc6be on fortify-source-3
into 89ae57e on master.

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

Successfully merging this pull request may close these issues.

2 participants