Closed mkoeppe closed 4 years ago
Duplicate of #80. I'm open to pull requests, provided that they don't break anything on other systems.
First of all, cysignals really doesn't work with _FORTIFY_SOURCE
since it abuses the stack in ways that violate some -D
_FORTIFY_SOURCE` checks.
The best solution would be for Cython to allow adding arbitrary code in the beginning of the generated .c
file. Then we could simply write
#undef _FORTIFY_SOURCE
there.
cysignals
tries to make sure that_FORTIFY_SOURCE
is undefined by usingExtension(undef_macros=...)
(https://github.com/sagemath/cysignals/blob/master/setup.py#L46).distutils.ccompiler.CCompiler.gen_preprocess_options
generates the compiler flag-U_FORTIFY_SOURCE
from that.However, Fedora uses
-Wp,-D_FORTIFY_SOURCE=2
, which is passed directly to the C preprocessor and overrides the-U
flag.See https://trac.sagemath.org/ticket/29473