Better fix for when CFLAGS includes -D_FORTIFY_SOURCE #226
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The module signals.pyx has to be built with fortify disabled, because of
a false positive in one of the
longjmp()
, more precisely in the callwhich appears in
setup_trampoline()
.Often distributions will add
-D_FORTIFY_SOURCE=2
toCFLAGS
, and sothis has to be overridden when compiling
signals.pyx
by adding-U_FORTIFY_SOURCE
to the compiler arguments. The former solution,using
add_project_arguments()
doesn't work since it will add flagsbefore the ones provided in
CFLAGS
.Instead, add
-U_FORTIFY_SOURCE
to the arguments in the definition ofthe extension module
signal
, which will add it to the command lineafter the ones provided in
CFLAGS
. In addition, fortify is disabledonly for building
signal.pyx
.