Better fix for when CFLAGS includes -D_FORTIFY_SOURCE - #226
Merged
Conversation
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 call ``` cylongjmp(trampoline_setup, 1) ``` which appears in `setup_trampoline()`. Often distributions will add `-D_FORTIFY_SOURCE=2` to `CFLAGS`, and so this 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 flags *before* the ones provided in `CFLAGS`. Instead, add `-U_FORTIFY_SOURCE` to the arguments in the definition of the extension module `signal`, which will add it to the command line *after* the ones provided in `CFLAGS`. In addition, fortify is disabled only for building `signal.pyx`.
Member
Author
|
@cxzhong this is better than removing the check in Try to see why this is useful. With this PR, it works just fine. |
Member
Author
|
@tobiasdiez this is still useful, I only rebased on current main. |
Contributor
|
@dimpase could you please merge this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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=2toCFLAGS, and sothis has to be overridden when compiling
signals.pyxby adding-U_FORTIFY_SOURCEto 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_SOURCEto 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.